Skip to content

Instantly share code, notes, and snippets.

@UeldoTheme
UeldoTheme / .htaccess
Last active May 10, 2018 18:23
Different ways to fix the HTTP image upload errors in WordPress
SetEnv MAGICK_THREAD_LIMIT 1
@UeldoTheme
UeldoTheme / my-google-analytics-code.php
Created May 4, 2018 11:03
Simple plugin to add Google Analytics tracking code to your WordPress
<?php
/*
Plugin Name: My Google Analytics Tracking Code
Description: Add Google Analytics tracking code to WordPress website
Version: 1.0
*/
@UeldoTheme
UeldoTheme / .htaccess
Created April 25, 2018 10:12
Add this to your .htaccess file to fix the "Leverage browser caching" issue on performance reports
# start expires caching #
ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/x-icon "access 1 year"
ExpiresByType application/pdf "access 1 month"
@UeldoTheme
UeldoTheme / .htaccess
Created April 23, 2018 18:37
Disable directory listing on your website with this code added to your .htaccess file
Options All -Indexes
@UeldoTheme
UeldoTheme / disable-error-reporting.php
Created April 23, 2018 18:37
Add this code to your "wp-config.php" WordPress file to disable PHP error reporting.
// turn debugging off
define( 'WP_DEBUG', false );
// turn off the display of error messages on your site
define( 'WP_DEBUG_DISPLAY', false );
// hide errors from being displayed on-screen
@ini_set( 'display_errors', 0 );
@UeldoTheme
UeldoTheme / auto-core-updates.php
Created April 23, 2018 18:34
Add this code to your "wp-config.php" WordPress file to enable automatic core updates.
define( 'WP_AUTO_UPDATE_CORE', true );
@UeldoTheme
UeldoTheme / disallow-file-edit.php
Last active April 23, 2018 18:35
Add this code to your "wp-config.php" WordPress file to disable file edition in your admin panel.
define( 'DISALLOW_FILE_EDIT', true );
<?php
/*
Plugin Name: Custom Buttons Shortcode
Description: Add buttons to your WordPress website with single simple shortcode
Author: Martanian <support@martanian.com>
Author URI: http://themeforest.net/user/martanian
Version: 1.0
@UeldoTheme
UeldoTheme / custom-button.html
Last active April 16, 2018 09:51
Example custom HTML button for WordPress posts and pages
<div style="margin: 30px 0;">
<a href="http://example.com/" target="_blank" style="display: inline-block; text-align: center; padding: 10px 25px; background: #e73a30; color: #fff; font-size: 17px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; border-bottom: 2px solid #b7241b;">Click here!</a>
</div>
@UeldoTheme
UeldoTheme / video-embed.txt
Created April 16, 2018 07:35
Embed videos or other assets on your WordPress posts and pages.
# simply put video embed URL...
https://youtu.be/uVju5--RqtY
# or specify static width and height values
[embed width="123" height="456"]https://youtu.be/uVju5--RqtY[/embed]