How to get the first category name or id from post

Many people want to know about post category and know more information current category. Some time we need to use the first category of wordpress post. As we know we can define the multiple category to single article. So if … Continue reading

How to set different layout for each category in WordPress

Using following code you can able to set different layout for each category. Just create the category.php file or already existed then open that file and use following code in that file. <?php if (is_category(10)) { // looking for category … Continue reading

How to use conditional tags in WordPress themes and plugins.

How to check page is subpage or parent page. We got this particular requirement of wordpress menus. For that we need many times parent page menu and sub pages as submenu. Using following code we can able to find the … Continue reading

How to use conditional tags in WordPress themes and plugins

The Conditional Tags  are most useful in creating the wordpress themes and plugins. The Conditional Tags can be used in your Template files to change what content is displayed and how that content is displayed on a particular page depending … Continue reading

How To Use Template Tags In WordPress Theme

What is meaning of a Template Tag in WordPress A template tag is code that instructs WordPress to “do” or “get” something. In the case of the header.php template tag for your WordPress site’s name, it looks like this: <?php … Continue reading

Functions.php file is important in wordpress theme

WordPress is most powerful tool for SEO and bloggers. We all need the custom theme for our projects. When we are creating the custom wordpress theme then functions.php file is so important. Here is the detailed information about functions.php file. … Continue reading

Basic CSS rules for development of WordPress themes

Whenever you are developing the new wordpress theme, you need to put some css in your style.css file. If you are not adding that css in your theme then there is lot of changes to break your theme view. Some … Continue reading

How to set Media Icons in wordpress theme

Just put some jpg, png or gif files in your theme images folder. your_theme/images/audio.jpg your_theme/images/audio.gif your_theme/images/audio.png your_theme/images/mpeg.jpg your_theme/images/mpeg.gif your_theme/images/mpeg.png your_theme/images/audio_mpeg.jpg your_theme/images/audio_mpeg.gif your_theme/images/audio_mpeg.png Whenever you are putting the media files in post above icons will appear in your theme.

How to display most recent post from a category

Use following code for showing the recent post from category: <?php query_posts(‘showposts=1&cat= get_cat_id(‘category_name’)’); while(have_posts()) : the_post(); ?> <h3><a href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a></h3> <?php the_content(); ?> <?php endwhile; ?> You can replace the category_name to your category name

How to remove category word from your URL- WordPress and WordPressMU

Open your .htaccess file. This file you will find in your root directory. Just copy and past following code in that file. RewriteRule ^category/(.+)$$1 [R=301,L] Don’t forget to replace the to your site name. Have fun!