Skip to content
WJunction - Webmaster Forum

Invisible a selected category in main page

Status
Not open for further replies.
Hi WJ

I need a suggestion, I have wordpress blog I want add porn category in my blog but I want my porn category never show in main/home page. If any one want to see porn then he need to click on Porn category. I know it possible in DLE and other CMS but dont know how to do this in wordpress?

Please help me.
 

11 comments

Sure thing! Wordpress is awesome and very complete.
Use the conditional template tag is_home.

Do you know how to implement it?
 
This will do:

Code:
<?php if ( is_home() ) {
wp_list_categories('exclude=[COLOR="Red"]6[/COLOR]');
}else{
wp_list_categories();
}
?>

Just replace that 6 by the Porn category ID number.
 
MiTU,

Nothing to worry and this is really easy to do also. You can follow what Solutho said but there is a plugin to do this also.

Plugin - Simply Exclude

Install the plugin and visit the settings page. Do as the screenshots show below :

cSVzs.png


Well in my blog these are the categories and respectively do this in your blog too.

10tNB.png


I hope that helped you out.
 
Usually it's a bad idea to mess with the core files. Do your tweaks inside the theme.
About the page to edit, usually is at the beginning of the index.php inside the theme folder, but can be in the header. Depends on how the theme is coded.

Either way it's pretty easy to find the loop, just look for «wp_list_categories» on those files.
 
Status
Not open for further replies.

About the author

M
Active Member · Joined
300Mb Movie Encoder Movies, Sports
225
Messages
3
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom