How To Show Tag Cloud In WordPress
The following snippet will let you show tag cloud in WordPress.
1 2 3 4 5 6 7 8 |
<?php wp_tag_cloud(array( 'smallest' => 10, // size of least used tag 'largest' => 18, // size of most used tag 'unit' => 'px', // unit for sizing 'orderby' => 'name', // alphabetical 'order' => 'ASC', // starting at A 'exclude' => 6 // ID of tag to exclude from list )); ?> |
Snippet Source/Credit: WP-Snippets.com
How To Solve Multiple Loops Problem In WordPress
The following snippet will let you solve multiple loops problem in WordPress.
1 |
<?php wp_reset_query(); ?> |
How To Specify Autosave Interval In WordPress
Adding the following snippet to your theme’s wp-config.php file, you will be able to specify autosave interval in your WordPress website.
1 2 3 4 |
<?php # Autosave interval set to 200 seconds # define('AUTOSAVE_INTERVAL', 200); ?> |
Snippet Source/Credit: WP-Snippets.com
How To Speed Up Your WordPress
The following snippet will let you speed up your WordPress by placing the following in the .htaccess file, replacing the standard WordPress .htaccess code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# BEGIN WordPress RewriteEngine on # # Unless you have set a different RewriteBase preceding this # point, you may delete or comment-out the following # RewriteBase directive: RewriteBase / # # if this request is for "/" or has already been rewritten to WP RewriteCond $1 ^(index\.php)?$ [OR] # or if request is for image, css, or js file RewriteCond $1 \.(gif|jpg|css|js|ico)$ [NC,OR] # or if URL resolves to existing file RewriteCond %{REQUEST_FILENAME} -f [OR] # or if URL resolves to existing directory RewriteCond %{REQUEST_FILENAME} -d # then skip the rewrite to WP RewriteRule ^(.*)$ - [S=1] # else rewrite the request to WP RewriteRule . /index.php [L] # # END wordpress |
Snippet Source/Credit: Canonicalseo.com
How To Turn On More Buttons In WordPress Visual Editor
The following snippet will let you turn on more buttons in WordPress visual editor.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<?php function add_more_buttons($buttons) { $buttons[] = 'hr'; $buttons[] = 'del'; $buttons[] = 'sub'; $buttons[] = 'sup'; $buttons[] = 'fontselect'; $buttons[] = 'fontsizeselect'; $buttons[] = 'cleanup'; $buttons[] = 'styleselect'; return $buttons; } add_filter("mce_buttons_3", "add_more_buttons"); ?> |
Snippet Source/Credit: CSS-Tricks.com