• Resolved magicfun1

    (@magicfun1)


    So, I’ve gone over the ‘dynamic menu highlighting tutorial and made this work on my WordPress pages. Is there a way for me to make this work on a non-worpress website? Can one use the is_page() function outside of wordpress to pull off dynamic menu highlighting or is there a better way?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Can one use the is_page() function outside of wordpress

    No. It’s a WordPress conditional function. You could try adding the `current_page_item’ class to your non-WP page links.

    Thread Starter magicfun1

    (@magicfun1)

    so my current dynamic menu highlighting works on every page except the home page. Here is my current code:

    <ul id="nav">
            <li<?php if (is_home()) { echo " class=\"current_page_item\""; }?>><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    		<?php
    		if($kriesi_options['pagenav'] == 1){
    		wp_list_pages('title_li=&'.$kriesi_options['com_page']);}
    		else{
    		wp_list_categories('title_li=&'.$kriesi_options['com_page']);
    		}
    
    		?>
            </ul>

    it looks like is_home() doesn’t see that it is the home page for some reason. What else could I use to have this work?

    Try is_front_page().

    Thread Starter magicfun1

    (@magicfun1)

    excellent, thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘dynamic menu highlighting on non-wordpress pages’ is closed to new replies.