WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Question about page links (3 posts)

  1. Gentist
    Member
    Posted 8 years ago #

    I'm trying to make a few theme adjustments, which indicates what page you're on by highlighting the relevant link. However, it appears that the front page (the "root" page), isn't handled like a page you make yourself (it's not in the list). This means that I have to add a link to the front page myself, which means that it won't be very dynamic.

    Is there a way to make the front page ("root" page) part of the page list (the list of pages you've created), so that I can treat its link as I treat the links to the rest of the pages?

  2. BPartch
    Member
    Posted 8 years ago #

    Hello

    If I understand you just want the active (current) pages link to be different than the rest?

    If this is correct, than this might help: http://codex.wordpress.org/Dynamic_Menu_Highlighting

    If you have already read that and are still confused. You can refer to the main page by

    <?php
    if ( is_home() ) { $current = 'one'; }
    elseif ( is_page('Page Two') ) { $current = 'two'; }
    elseif ( is_page('Page Three') ) { $current = 'three'; }
    elseif ( is_page('Page Four') ) { $current = 'four'; }
    ?>

    Hope it helps!

  3. Gentist
    Member
    Posted 8 years ago #

    That's kind of what I wanted. It does solve this specific problem, but it may not be able to solve future, similar problems. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.