Automatically add Twitter and Facebook buttons to your posts

Posted by on Jan 28, 2011 in Wordpress | 1 comment

Automatically add Twitter and Facebook buttons to your posts

Paste the code below into your functions.php file, save it, and you’re done. function share_this($content){ if(!is_feed() && !is_home()) { $content .= '<div class="share-this"> <a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal">Tweet</a> <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> <div class="facebook-share-button"> ...

read more

How to show the “home” link on wp_nav_menu default fallback function

Posted by on Jan 28, 2011 in Wordpress | 0 comments

How to show the “home” link on wp_nav_menu default fallback function

You just have to paste the following code into your theme functions.php file: function my_page_menu_args($args) { $args['show_home'] = true; return $args; } add_filter('wp_page_menu_args', 'my_page_menu_args'); Thanks to Reza for this nice piece of code! Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!How to show the “home” link on wp_nav_menu default fallback...

read more

How to automatically add a search field to your navigation menu

Posted by on Jan 28, 2011 in Wordpress | 0 comments

How to automatically add a search field to your navigation menu

Open your functions.php file, and paste the following code. The search field will be displayed once you saved the file. add_filter('wp_nav_menu_items','add_search_box', 10, 2); function add_search_box($items, $args) { ob_start(); get_search_form(); $searchform = ob_get_contents(); ob_end_clean(); $items .= '<li>' . $searchform . '</li>'; return $items; } Thanks to Ronald for the cool tip! Looking for WordPress hosting? Try WP Web Host. Prices starts at...

read more

WordPress tip: Remove WP 3.1 Admin Bar

Posted by on Jan 28, 2011 in Wordpress | 0 comments

WordPress tip: Remove WP 3.1 Admin Bar

Simply paste the following line of code on your functions.php file: remove_action('init', 'wp_admin_bar_init'); Once the file is saved, the Admin Bar will not be displayed again. Thanks to Yoast for the tip! Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress tip: Remove WP 3.1 Admin...

read more

WordPress trick: Get category slug using category ID

Posted by on Jan 28, 2011 in Wordpress | 0 comments

WordPress trick: Get category slug using category ID

First, put the following function in your functions.php file: function get_cat_slug($cat_id) { $cat_id = (int) $cat_id; $category = &get_category($cat_id); return $category->slug; } Once done, you can call the function as shown below: <?php echo get_cat_slug(3); ?> This will display the slug for the category with the ID 3. Thanks to Ken Rosaka for the tip! Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress trick: Get category slug using category...

read more

How to set HTML editor as the default in WordPress

Posted by on Jan 28, 2011 in Wordpress | 0 comments

How to set HTML editor as the default in WordPress

Simply paste the following code on your functions.php file, save it, and you’re done! add_filter('wp_default_editor', create_function('', 'return "html";')); Credit: WP Snippets. Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!How to set HTML editor as the default in...

read more

Different number of posts for a WordPress category

Posted by on Jan 16, 2011 in Wordpress | 0 comments

Different number of posts for a WordPress category

WordPress allows you to vary how many blog posts you show on your blog, but it’s a single setting, and affects how many blog posts show over the whole website. This tip allows you to have a different number of posts for a particular category.

read more

How to easily get post ancestors

Posted by on Jan 16, 2011 in Wordpress | 0 comments

How to easily get post ancestors

When using WordPress as a CMS or building a breadcrumb, you often need to get the post ancestors. Today let’s have a look at how you can easily get post ancestors of a specific post.

read more

Automatically add a search field to your navigation menu

Posted by on Jan 16, 2011 in Wordpress | 0 comments

Automatically add a search field to your navigation menu

Do you ever wanted to be able to automatically add a search field to WP 3.0+ navigation menus? If yes, just have a look to today’s recipe, you’ll probably love it!

read more

Creating a New Year Action Plan for your website

Posted by on Jan 8, 2011 in Wordpress | 1 comment

Creating a New Year Action Plan for your website

New Year is a popular time for resolutions and fresh starts, so creating a website action plan will help you get organised and motivated as well as ensuring a good start to 2011!

read more