Display recent posts as thumbnails in sidebar in WordPress 2.9

April 28, 2010

Starting with WordPress 2.9 is no longer need to use custom fields and hacks to have thumbnails in your wordpress articles or even on widgets area, sidebars, footers etc.   For instance, to make a thumbnails area for random latest 10 recent posts, use the following code:   <?php $my_query = new WP_Query('showposts=10&orderby=rand'); if( $my_query->have_posts() ) { echo '<h1>Random Articles</h1>'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php $attachments... [Read the full story]

Remove Private prefix from wordpress private pages titles

April 1, 2010

We had the situation come up where we need a password-protected post in WordPress. Of course that is super easy in WordPress, you can set up a password for it right in the “Publish” box before publishing. But by default, WordPress appends “Protected: ” to the front of the post title, before and after the password has been entered. Maybe you didn’t like that, and thought that the password box was clue enough that the material was password protected. To remove theses private prefix, simply open your functions.php... [Read the full story]

Make an author box in WordPress

March 31, 2010

In this tutorial you will learn how to add the author’s profile box at the end of the wordpress post. If you have a gust authors it is good to have author’s profile box. You can easily change background, border colors by editing CSS code. Please make sure to backup theme before changing anything. Please add below CSS code in your style.css file which is located in your theme directory. #authorbox{ background:#EFEFEF; border:1px solid #CECFD0; width:638px; margin:0 auto; margin-bottom:10px; overflow:hidden; } #authorbox... [Read the full story]

Display list of wordpress pages in two columns

November 28, 2009

Usually in WordPress, the following code is used to call the pages list (you can find it in one of the sidebar files): <?php wp_list_pages(); ?> Normally when the list of pages is displayed in the sidebar or on any part of the theme, it displays in a single column. Through the following hack, you can split your pages list evenly into two or more columns which can save space and not make your pages longer. Now, we will try and split the pages into two columns. Simply paste the following code where you’d like your... [Read the full story]

Get tags related to wordpress category

October 13, 2009

Do you noticed there is no native way to retrieve tags based on the wordpress category. But if you want to be able to get tags related to one (or more) specific category, just insert the following function in your theme’s functions.php.   Here is the function you have to paste in your function.php file: function get_category_tags($args) { global $wpdb; $tags = $wpdb->get_results (" SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link FROM wp_posts as p1 LEFT JOIN wp_term_relationships... [Read the full story]