Jump to content
Stef's Coding Community

wordpress navigation problem


Recommended Posts

Hi , i have this issue, i am biulding a wordpress site and lets say i have two pages. Products for category A and the second page called Products for category B . The first page is the index.php of wp. In the second page i run a second loop to load the products for this particular category.

 

So, when i am in the second page and click the read more link for a product it shows the complete post. (single.php) But navigation bar shows that i am in the first page which is the default page as i said.

 

The question is how can i make the nav bar be highlighted the second page when i read one of the second page's product post?

 

I hope you understand what i am trying to tell

Link to post
Share on other sites

Well , that's not the issue. Let's see, when you view a post (single.php) the .current_page_item class is assigned to the page that i chose to be the blog page. Is there any way that when i view a post's full article from the second page, which is not the blog page, the.current_page_item class couldbe assigned to the second page?..

 

 

See my site to understand what i mean.

http://easyjquery.gr/

 

and go to the tutorial page and view a post to see what's happening to the nav bar.

Link to post
Share on other sites

Sorry, can't help with that. I just checked on the WP site I'm currently working on, and when I go to a blog page, I don't have a current page marker at all - which I guess is better than one on the wrong page. However, I have no idea what causes one or the other.

Link to post
Share on other sites

Thank you Andrea.

 

The only trick i came up is by using jquery.

 

i check the category that the post belongs and if it is in the second page i use jquery to remove the class .current_page_item from the blog page and add it to the econd page. It does the trick although it has a little lag until the page is full loaded...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...