List the most popular wordpress posts according to comment count

May 23, 2010

If you want to have a section on the home page where you list the most popular posts of the month, according to comment count. it’s always best to write the code yourself if you can. Once we learn how to query WordPress database, tasks like this become easy. To query WordPress database, we can use the $wpdb->get_results() method. As the parameter, we simply pass a SQL query. In this particular example, let’s say that we only want to display a list of popular posts within our sidebar. We can use the following... [Read the full story]

Creat Login form for wordpress front page

May 23, 2010

How to create a Login form for your wordpress users, which can be placed in your sidebar, footer or anywhere else on your page? What we want to display is: An input field for user name An input field for password A checkbox for remembering the user A hidden field which tells WordPress where to redirect the User after login took place A Submit Button 2 Links: One for password recovery, one for new registration Since we want to make the form work in every template we will make use of the function get_option(‘home’)... [Read the full story]

Create frontend Admin Menu in WordPress

May 23, 2010

Here is a short tutorial on how to create an additional WordPress menu that only shows up if a user is logged in. We can use this technique to create admin front end interface menus for the most used tasks: writing and editing posts and pages, editing the current post , a direct link to the “manage” Section of the WordPress admin Interface etc. This is easily done with the WordPress function current_user_can() As a parameter for the function you just have to add the expected user level and wrap the whole function... [Read the full story]

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]