Put HTML tags into wordpress post title

May 25, 2010

You don’t want to go putting HTML tags directly into post titles. It might show up OK on your own site, but it can be problematic. For example, your titles through RSS will show the tags as next, not render them, here is almost-as-simple way to go about it. 1. Enter title without HTML 2. Create a custom field “HTML_title” for the title with HTML 3. Output custom field on pages you want the HTML For example, on the single.php page where you would have used <h1><php the_title(); ?></h1> Now... [Read the full story]

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]