jasotasticon
asked on
Wordpress - highlight "post page" menu item with static home
Here is my exact problem:
http://wpgarage.com/wordpress-as-cms/wordpress-challenge-getting-class-current_page_item-to-work-when-home-page-is-not-blog/
There are a bunch of solutions here, but they all require messing with core files...
Can anyone think of clean way to do this?
http://wpgarage.com/wordpress-as-cms/wordpress-challenge-getting-class-current_page_item-to-work-when-home-page-is-not-blog/
There are a bunch of solutions here, but they all require messing with core files...
Can anyone think of clean way to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is the benefit of using child themes and functions.php
As an example I am using Thematic on a new site
I have a standard drop down menu in the header, and another one in the footer, but I also wanted different menu items for visitors and members.
This is the code I used for the new menu for visitors
/// Top Page Navigation
// Add a dynamic menu using wp_list_pages
function childtheme_menu() { ?>
<div class="menu">
<ul class="sf-menu">
<?php wp_list_pages('include=2,1 5&sort_col umn=post_d ate&title_ li='); ?>
</ul>
</div>
<?php }
add_action('wp_page_menu', 'childthem e_menu');
This is the code for the items in the footer
// Footer section for terms of service etc
function footer_pages() { ?>
<div id="footer-page" class="footer-page-div">
<div id="list-block">
<ul class="footer-pages">
<?php wp_list_pages('include=13, 12,14,81,1 02&sort_co lumn=post_ date&title _li='); ?>
</ul>
</div>
</div>
<?php }
add_action('thematic_below footer','f ooter_page s');
What I still have to do is use is_use_logged_in() for another menu for logged in users
The new menu system in 3.0 will work better, but there will still be a need to drop down to functions.php or use a plugin for some things, it is just how things are.
I am not much of a programmer, but I know how to search with Google and use code snippets.
As an example I am using Thematic on a new site
I have a standard drop down menu in the header, and another one in the footer, but I also wanted different menu items for visitors and members.
This is the code I used for the new menu for visitors
/// Top Page Navigation
// Add a dynamic menu using wp_list_pages
function childtheme_menu() { ?>
<div class="menu">
<ul class="sf-menu">
<?php wp_list_pages('include=2,1
</ul>
</div>
<?php }
add_action('wp_page_menu',
This is the code for the items in the footer
// Footer section for terms of service etc
function footer_pages() { ?>
<div id="footer-page" class="footer-page-div">
<div id="list-block">
<ul class="footer-pages">
<?php wp_list_pages('include=13,
</ul>
</div>
</div>
<?php }
add_action('thematic_below
What I still have to do is use is_use_logged_in() for another menu for logged in users
The new menu system in 3.0 will work better, but there will still be a need to drop down to functions.php or use a plugin for some things, it is just how things are.
I am not much of a programmer, but I know how to search with Google and use code snippets.
ASKER
Ah, this is very interesting! I had not heard of this method before (I am not a programmer either, I just get paid to do it ; )
Thanks for the info! I will give it a try.
- J
Thanks for the info! I will give it a try.
- J
ASKER
Sorry, I meant theme not core... I can go in and edit it there I guess. Just so frustrating having to make all these little edits to theme for things that ideally would, "Just work."
thanks though,
- J