Remove admin name in wordpress comments class
May 25, 2010
Every time we posted a comment, WordPress automatically added a class that pretty much told everyone our admin login name. The offending class is the “comment-author-admin” class. We can created a code snippet that can quickly remove the offending class from every comment. Just add follow code to your functions.php file: function remove_comment_author_class( $classes ) { foreach( $classes as $key => $class ) { if(strstr($class, "comment-author-")) { unset( $classes[$key] ); } } return $classes; } add_filter(... [Read the full story]
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]




















