How to disable automatic paragraphs in WordPress editor
Simply paste the following line into your functions.php file: remove_filter('the_content', 'wpautop'); That's all. Once you saved the file, WordPress will no longer create automatic paragraphs on your...
View ArticleHow to easily make WordPress images responsive
The first thing to do is to create the shortcode. To do so, open your functions.php file and paste the following code in it: function responsive_images($atts, $content = null) { return '<div...
View ArticleWordPress function to show a total share counter (FB, Twitter, G+)
Simply paste the following function where you want your counter to appear: function social_shares() { $url = get_permalink( $post_id ); $json =...
View ArticleGrid Layout Shock giveaway: 10 licenses to win!
About Grid Layout Shock Grid Layout Shock is a responsive WordPress plugin to create cool Pinterest-like grids using your posts, or external content (RSS). With several customization options to make...
View ArticleHow to allow more HTML tags in WordPress comments
Simply paste the following code in your functions.php file. The list of tags to allow can be modified on line 4. // Create function which allows more tags within comments function allow_pres() { global...
View Articlesql query to delete orphaned post meta in your WordPress database
Just run the following query on your WordPress database to delete orphaned post meta. Don't forget to replace the table prefix wp_ if your database is using another prefix. And of course, create a...
View ArticleHow to run the loop outside of WordPress
Paste the following code on any PHP file where you want to run your WordPress loop. Don't forget to modify the following: line 4: Please specify the path to your WordPress wp-blog-header.php file. line...
View ArticleLawyerWordPressThemes giveaway: Win an awesome theme for your blog
About Lawyer WordPress Theme Our sponsor is LawyerWordPressThemes, a new WordPress premium theme seller which specialize in the law/attorney niche. But of course, the "Lawyer" theme can be used for any...
View ArticleHow to only display the author posts in the admin post list
Paste the code below into your functions.php file. Once you saved the file, authors will only see their own posts in the admin post list. <?php function mypo_parse_query_useronly( $wp_query ) { if (...
View ArticleHow to activate link manager on WordPress 3.5 (and newer)
Just paste this code into your functions.php file, and you're done! <?php //Activate the Link Manager built in to the WordPress admin add_filter( 'pre_option_link_manager_enabled', '__return_true'...
View ArticleThemes4All giveaway: 3 premium themes to win!
About Themes4All.com Our sponsor is Themes4All.com, which is a newcomer in the WordPress premium theme business. They specialize in low cost/high quality themes. They already released 20+ themes, each...
View ArticleHow to directly include Typekit fonts on your WordPress theme
Edit the code below and update the .js file path on line 2. Then, simple paste it on your functions.php file. Save the file, and you're done! function theme_typekit() { wp_enqueue_script(...
View ArticleHow to redirect to post if search results only returns one post
Just paste the following code snippet into your functions.php file: add_action('template_redirect', 'redirect_single_post'); function redirect_single_post() { if (is_search()) { global $wp_query; if...
View ArticleHow to force your WordPress blog to break out of frames
Nothing complicated, just paste the code below into your functions.php file, save it, and you're done. // Break Out of Frames for WordPress function break_out_of_frames() { if (!is_preview()) { echo...
View ArticleHow to detect a comments page on your WordPress blog
Simply put the following code anywhere on your theme files. If you're on a comment page, the conditional statement will return true, so any code within brackets will be executed. $cpage =...
View ArticleHow to display an author bio excerpt on your WordPress blog
The first thing to do is to create the function. To do so, paste the following code into your functions.php file: <?php function author_excerpt (){ $word_limit = 20; // Limit the number of words...
View ArticleHow to create a directory within the uploads folder
Simply paste this code snippet on your functions.php file (or plugin file if you're creating a plugin) function myplugin_activate() { $upload = wp_upload_dir(); $upload_dir = $upload['basedir'];...
View ArticleHow to add SVG upload support to your WordPress blog
Simply add the code below to functions.php in your WordPress theme. SVG upload will be supported once the file is saved. add_filter('upload_mimes', 'my_upload_mimes'); function my_upload_mimes($mimes =...
View ArticleHow to make translatable JavaScript strings on your WordPress theme
Simply paste the following code into your function.php file, where you generally enqueue scripts and styles. Line 4 shows how to use the wp_localize_script() function. function...
View ArticleDeal of the week: SpyBar (3 licences to win!!)
A word about Spybar The Internet is one huge swap meet. So many sites "borrow" code or plugins from other sites to make their own that much better. And then someone else borrows from their site, and so...
View Article