Forums

Changing style of specific page title in navbar (7 posts)

  1. henock1
    Member
    Posted 3 years ago #

    Hello, website is http://www.nbntoday.com

    I'd like to have one of the pages (voicemails, share, about) a different color text. How is this possible? I'm still fresh to php.

  2. tugbucket
    Member
    Posted 3 years ago #

    <?php if (is_page('voicemails')  || is_page('share') || is_page('about')) { ?>
    <style type="text/css">
    #text {
    color: #e99;
    </style>
    <?php }; ?>

    is a simple way. you could also give your body a class realted to the page you're on and then set the color in your CSS page.

  3. henock1
    Member
    Posted 3 years ago #

    I'm sorry, I wasn't clear about exactly what I needed. I would like one of the page's links to be colored text and have it hover white....instead of just a white link.

  4. tugbucket
    Member
    Posted 3 years ago #

    <?php if (is_page('pagename') { ?>
    <style type="text/css">
    a {
    color: #e99;
    }
    a:hover {
    color: #fff;
    }
    </style>
    <?php }; ?>
  5. henock1
    Member
    Posted 3 years ago #

    I get a:

    Parse error: syntax error, unexpected '{' in /"abspath"/header.php on line 126

    <?php if (is_page('pagename') { ?>
    <style type="text/css">
    a {
    color: #e99;
    }
    a:hover {
    color: #fff;
    }
    </style>
    <?php }; ?>
    
    <?php /* If this is the frontpage */ if ( is_home() ) { ?>
    <li class="current_page_item"><a>/">Front Page</a>
    <?php } else { ?>
    <li class="page_item"><a>/">Front Page</a>
    <?php } ?>
    <?php wp_list_pages('depth=1&sort_column=menu_order&title_li=' . __('') . '' ); ?>

    Obviously i'd change the slug but the page won't even process. Did I do something wrong?

  6. tugbucket
    Member
    Posted 3 years ago #

    oops I missed a ")"

    <?php if (is_page('pagename')) { ?>
    <style type="text/css">
    a {
    color: #e99;
    }
    a:hover {
    color: #fff;
    }
    </style>
    <?php }; ?>

    try that

  7. sdriedger
    Member
    Posted 2 years ago #

    Thank you tugbucket,

    That is exactly what I needed to customize one of my pages.

    :-)

Topic Closed

This topic has been closed to new replies.

About this Topic