WordPress Theme Hacks And Tips

Wordpress was released as a blogging template in early days. Now developers has made the wordpress a very flexible tool for creating any type of website. In this tutorial, I'll tell you wordpress inner hacks, so let's start.

Conditional Tags in wordpress:

If you want to create a dynamic and flexible theme, then conditional tags will help you. Conditional tags are that let you define, how the content of your website that you'll put in your admin side will display on the font-end. Following are the sample uses of conditional tags:


Dynamic Highlight Menu:

Highlight Menu means display name of menu item with your wordpress website on the browser tab. So wordpress provides many hooks to accomplish, look at the following code screenshot.

dynamic highlight menu

Dynamic tag for titles:

Use the following code in you header.php file inside head for displaying dynamic titles.

Dynamic displaying the Content:

If you want to display your content only on your home or font page, so use the following code.


Different single templates for posts:

If your website have the requirement for different detail page for your different posts, so use the following code:


Displaying the latest posts:

Following code will show you the 5 posts per page, if you have pagination, then next 5 posts on the page 2.


Exclude specific category posts:

If you don't want to show posts from a specific category, so exclude the category posts using the following code:




20 comments:

  1. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    data analytics courses in hyderabad with placements

    ReplyDelete