Say my WordPress site has these sections:
Blog
News
Articles
Memories
News, articles, and memories would be custom “post types” that I created. How do I get these sections to operate completely independently of one another?
In terms of menu highlighting, so far when I try this the “Blog” menu item is always highlighted in addition to the section that I am currently in. So if I go to articles, “Articles” is highlighted as well as “Blog.”
This appears to be a CSS issue, but at the same time I can’t help feeling perhaps I don’t have it set up correctly for what I am trying to accomplish.
Any help would be appreciated. Thanks.
]]>.col4 .current_menu_item a {
color:#06C;
font-style:italic;
font-weight:600;
}
Any tips on how I’m targeting this wrong would be greatly appreciated.
]]>I see that current_page_ancestor will make the top level item highlighted, but it also seems to highlight all the other items between the item clicked and the top level item. Essentially I just want the behaviour that WordPress has at the top of this page – only the top level item highlighted. Is this possible?
]]>I’m currently building a theme and am having a small problem with wp_nav_menu. Firstly, here is my template code:
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
And here is my CSS that controls the currently active menu item/page/post:
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
color: #FFF;
background: #F45300;
border: 1px solid #C84502;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
-moz-box-shadow:inset 0 0 4px #C64503;
-webkit-box-shadow:inset 0 0 4px #C64503;
box-shadow:inset 0 0 4px #C64503;
}
Now this is working perfectky for every single page/post except for my homepage. Does anybody know why? I am using a static homepage by the way.
Thanks!
]]>I set up a custom post type called ‘events’ which required me to create an events page for listing these posts. When on the events page the vertical submenu it is associated with appears.
My problem is when I click on one of the event posts (single view) the vertical submenu disappears, because it is only associated with the events page. How can I associate all of the custom posts for events with a menu so that the menu displays.
]]>I am using a static nav, because some of my buttons go to strange pages and I don’t want any sub pages to appear under parent page buttons, here it is:
[please mark your code using the code button]
<div id="main-nav">
<ul id="navigation">
<li id="one"><a href="#">current projects</a>
<li id="two"><a href="#2">completed projects</a>
<li id="three"><a>profile</a>
<li id="four"><a>perspective</a>
<li id="five"><a href="#5">pin-ups</a>
<li id="six"><a href="#6">contact</a>
<ul>
</div>
The reason I am using a static nav instead of a wp menu() function is because I don’t want any drop downs or access to sub pages in the nav. If somebody can guide me to how I can do some menu highlighting with this nav, any help is greatly appreciated. Or if you have any other ideas on how I can achieve it, please let me know.
I tried using the codex tutorial but I can’t get it to work…
]]>I am building a theme: https://wp-themes-and-plugins.com/ and am trying to highlight the current page ( active ) in the top navigation menu. I’m using the ( 3.0 menu system )
For functions.php – code I’m using: `<? if (function_exists(‘add_theme_support’)) {
add_theme_support(‘menus’);
} ?>`
For the header.php – code I’m using: <?php wp_nav_menu('menu=main_menu'); ?>
I can not seem to get the current page menu title to highlight when active. I’ve used resources from several different sources that provide tutorials on doing this – none of them work for me.
Resources I’ve tried:
Any assistance will be very much appreciated.
Thanks in advance
]]>