GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   wordpress: different menus for different categories? (https://gfy.com/showthread.php?t=798940)

Angry Jew Cat - Banned for Life 01-11-2008 02:34 PM

wordpress: different menus for different categories?
 
can you do different menu content for different categories pages on the blog?

StarkReality 01-11-2008 03:04 PM

Should be pretty easy to code in php, but unfortunately I don't know any plugin around doing this...someone got some code for this ready ?

bangman 01-13-2008 11:04 PM

Outside LOOP...
Code:

<?php
 $post = $wp_query->post;
 if ( in_category('2') ) {
// do something if they are in category 2
 } else {
 // show regular menu, or remove this else
 }
 ?>

So what you could do is insert the above code above your regular menu and either include your regular menu in this if statement or do something like:

Code:

<?php

// required for outside of post
 $post = $wp_query->post;

// if the current post is in category 2
 if ( in_category('2') ) {

// do something if they are in category 2

 } else { ?>

this is my regular menu HTML.<br />
<ul>
<li>Menu Item</li>
<li>Menu Item</li>
<li>Menu Item</li>
</ul>

 <?php } ?>

Let me know if you need some help.


All times are GMT -7. The time now is 02:22 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123