Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6028995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:49:16+00:00 2026-05-23T04:49:16+00:00

On this site: http://jumpthru.net/newsite/vision/ I am using CSS sprites for my navigation with PHP

  • 0

On this site:
http://jumpthru.net/newsite/vision/

I am using CSS sprites for my navigation with PHP else statements to show the active state for the current page. All of the pages are working properly except for the page that contains the loop / blog postings ( http://jumpthru.net/newsite/commentary/)

Do I need to call the php differently for this page?

The PHP :

<?php
if ( is_page('vision') ) { $current1 = 'visionside a'; }
elseif  ( is_page('team') ) { $current2 = 'teamside a'; }
elseif  ( is_page('commentary') ) { $current3 = 'blogside a'; }
elseif  ( is_page('organizations') ) { $current4 = 'orgside a'; }
?>

The CSS:

#sidebarnav ul#sidenav li.<?php echo $current1; ?> {
background:url(http://jumpthru.net/newsite/wp-content/themes/twentyten/images/side/vision2.png)  0px -106px !important;

}

#sidebarnav ul#sidenav li.<?php echo $current2; ?> {
background:url(http://jumpthru.net/newsite/wp-content/themes/twentyten/images/side/team2.png)  0px -106px !important;

}

#sidebarnav ul#sidenav li.<?php echo $current3; ?> {
background:url(http://jumpthru.net/newsite/wp-content/themes/twentyten/images/side/content2.png)  0px -106px !important;

}

#sidebarnav ul#sidenav li.<?php echo $current4; ?> {
background:url(http://jumpthru.net/newsite/wp-content/themes/twentyten/images/side/org2.png)  0px -106px !important;

}

Any help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:49:16+00:00Added an answer on May 23, 2026 at 4:49 am

    I have a solution that is a bit different than what you are looking for, but is a much better solution to what you are doing.

    PHP:

    <?php 
    
    if ( is_page('vision') ) 
      $page = 'vision';
    elseif ( is_page('team') )
      $page = 'team';
    elseif ( is_page('commentary') )
      $page = 'blog';
    elseif  ( is_page('organizations') ) 
      $page = 'org';
    
    ?>
    
    <body id="page-<?php echo $page; ?>">
    ...
    

    Note about above PHP: If you had a get_page_id() function, you could simplify this a lot more. by simply having <body id="page-<?php get_page_id(); ?>">

    HTML:

    <ul id="sidenav">
        <li class="visionside"><a href="#">...</a></li>
        <li class="teamside"><a href="#">...</a></li>
        <li class="blogside"><a href="#">...</a></li>
        <li class="orgside"><a href="#">...</a></li>
    </ul>
    

    CSS:

    body#page-vision #sidenav li.visionside a,
    #sidenav li.visionside a:hover {
       ...
    }
    

    Note about above CSS: There are two lines listed above that you can style together – the current state, and the hover state. This will make the current state display when you hover over the nav, regardless of which nav is the “current” nav.

    Seeing that you’re interested in using CSS Sprites, I would definitely recommend that you read up on this article.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this web site (photoblog) http://www.OneReaction.net/ and I am very curious how this
This is what my browser sent, when logging into some site: POST http://www.some.site/login.php HTTP/1.0
I have a site with URLs like this: http://domain.co.uk/subdir/page.php I have redesigned the site
I know this site is written using ASP.Net MVC and I do not see
on this site: http://yoursdproperty.com/index.php?option=com_jumi&fileid=8&Itemid=34 as you can see the white background a little bit
at this site: http://yoursdproperty.com/index.php?option=com_jumi&fileid=8&Itemid=34 you will see on the left there is a navigation
On this site: http://67.15.245.6/~paddyosh/ the main navigation has suddenly stopped changing, i am sure
On this site http://church.allthingswebdesign.com/Contact-Us.php , the links on the left work fine in every
I used this site: http://www.generateit.net/gradient/index.htm?start_colour=%23FFFFFF&end_colour=%23666666&height=20&width=1&type=top to generate a 20 pixel hight and 1 pixel
I have replicated a toggle functionality from this site: http://www.williamsprofessionalpainting.com/FAQ.php Here is the updated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.