WordPress.org

Ready to get started?Download WordPress

Forums

Dynamic Menu Highlighting (6 posts)

  1. fuBarness
    Member
    Posted 7 years ago #

    For the past week, I have been trying to figure out how to make my website's navigation into a dynamic menu. However, it has been a complete frustration for me. For one, I lack CSS/PHP knowledge and two, I am trying to understand the logic of PHP. I took a VB.NET course not too long ago, it gave me some hints with the if... else... statements that it wasn't enough to make me understand some principles of PHP.

    Here is the article that I read on WP.org: http://codex.wordpress.org/Dynamic_Menu_Highlighting

    I am a little frustrated, I am hoping that someone can assist me.

    First of all, when one menu is inactive, it has the following tags (class="home" and id="home"). If active it goes (class="homea" and id="homea"). I don't know how to make it into PHP.

    Thanks.

  2. fuBarness
    Member
    Posted 7 years ago #

    Oh yes, I forgot to link my websites to see what the issue is.

    Normal: http://gantdesigns.com
    WP Issue: http://gantdesigns.com/wordpress

  3. vkaryl
    Member
    Posted 7 years ago #

    You might want to hit http://themes.wordpress.net/, search for wp-andreas01-12, and look over the code for the dynamic highlighting in that theme.

  4. fuBarness
    Member
    Posted 7 years ago #

    I checked the source code of the template.

    But I am still quite confused. All it states in PHP is 'fetching' the PHP include. But I don't how to customize it or re-organize it.

    Anyone?

    Thanks.

  5. preckie
    Member
    Posted 7 years ago #

    i have the same problem, the only difference is, i just need to change the id when it is selected. for example, a tab that is unselected would have id="home". when it is selected, id="homeslected" would be displayed. i don't know how to write php scripts, but i think it has something to do with elseif bla bla bla. just a guess! lol

    <?php
    if (is_home())
    {
    echo " id=\"current\"";
    }
    else if {idontknow}?>

    i hope someone could help. thanks a lot.

  6. chuckp
    Member
    Posted 7 years ago #

    I did not have any luck with the codex procedure but I did have some luck with the below website after reading all the way down to the end of the comments. The only problem I'm having now is that my "Posts Page" (WP 2.2.1) link (I called it "News") will not highlight using the "is_page" call when I'm on my "News" page.

    Dynamic Link process that worked for me (read to the end):
    http://green-beast.com/blog/?p=157

    My website:
    stpaulsms.org

Topic Closed

This topic has been closed to new replies.

About this Topic