Jump to content


Photo
- - - - -

Adding subnav only on specific pages


This topic has been archived. This means that you cannot reply to this topic.
13 replies to this topic

#1 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 11 March 2010 - 11:41 PM

I have enabled the Drop Down menus for the nav bar, but on one page, I'd like to have some sub nav available. My site is www.elizabethlyons.com. For example, if you rollover Books in the nav bar, 3 choices are available. If you click on You Cannot Be Serious, I'd like there to be 4 new links on which the user can click at the top of the You Cannot Be Serious page. These links would only be accessible via this page. How could I do this? Thank you!

#2 arpowers

arpowers

    Founder

  • Administrators
  • 3270 posts

Posted 12 March 2010 - 01:16 AM

have you looked around for plugins? by subnav you mean the one underneath the header? to get that right you might have to add a couple custom functions to the subnav code,

#3 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 15 March 2010 - 10:14 PM

I have not been able to find a plug-in that will accomplish this only on certain pages. I think Jeff was looking into how I could modify the code, and it may very well be that I need to add some custom functions to the subnav code. I just need some direction on how to do it!

#4 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 16 March 2010 - 12:46 AM

hey elyons :) this is jeff.

So what we'll want to do is add a condition to the subnav code:

Please Login or Register to see this Hidden Content


Replace [page-slug-for-book1] with the appropriate page-slug. Same goes for the other two books.
Let me know if that makes sense.

#5 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 16 March 2010 - 02:09 AM

Hi Jeff! This does make sense. We'll see how much when I go to put it into action! Does it matter where in the subnav.php code I put your modifications? At the top of the code, the following code appears: ` post_parent || wp_list_pages("title_li=&child_of=".$post->ID."&echo=0")) && !$bbpress_forum && !is_search() ):?>

#6 arpowers

arpowers

    Founder

  • Administrators
  • 3270 posts

Posted 16 March 2010 - 03:52 AM

I believe you would add it to the beginning of the if statement: `if (is_page('[page-slug-for-book1]') || ($post->post_parent || wp_list_pages....`

#7 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 16 March 2010 - 04:14 PM

elyons, i should have been more clear. my apologies. You'll find `` in the header.php file. Replace that line with: ``

#8 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 16 March 2010 - 08:42 PM

Jeff-

Okay. So far so good! The new sub nav page is working as a separate drop down menu off the first. I'd also like it so that when you go to the You Cannot Be Serious subpage (off Books) you see the names of the subnav pages across the top of the page. So, if someone is in the You Cannot Be Serious page, they see across the top the various other pages they can go to from that page only (the first would be the Treat of the Moment).

Does that make sense? How do I do that?

Posted Image

#9 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 17 March 2010 - 12:57 AM

Hm. Is this the code you entered? `` Also on a sidenote, I noticed on your feature page, you're not using the feature boxes. To hide the feature boxes underneath the main feature box slider, add this code to the Custom Code > CSS Rules field: `#container .fboxes {display:none}`

#10 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 17 March 2010 - 01:26 AM

Perfect - I removed the feature boxes. Thanks for catching that! Yes - the code you entered above is the code I entered. Is it correct? Liz

#11 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 17 March 2010 - 04:39 PM

Liz, sorry there were some typos in my code above. I fixed those errors in the post and entered it again below! Try this one last time, and let me know if it works. ``

#12 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 17 March 2010 - 04:55 PM

Hi Jeff -

That allowed the regular subnav to be there on the You Cannot Be Serious page (which is a sub page of Books) but it didn't allow the subnav pages of You Cannot Be Serious to be shown (see image attached).

When I go to the individual subnav pages of Books, the other pages show up on the right hand sidebar (see 2nd attachment), but from the main You Cannot Be Serious page, other than seeing it in the drop-down box, the user has no way to know that there are the Treat of the Moment, Inspiration, etc. page.

Posted Image

Posted Image

#13 elyons3683

elyons3683

    Advanced Member

  • Members
  • PipPipPip
  • 88 posts

Posted 17 March 2010 - 04:57 PM

That 2nd screen shot wasn't great. Here's another one. This is what you get in the sidebar when you are ON the subnav pages of the You Cannot Be Serious page. But when you're on the main You Cannot Be Serious page, you only see the Books subnav menu, not the You Cannot Be Serious subnav menu. Is this the biggest mess you've ever seen?

Posted Image

#14 jnoh

jnoh

    Advocate

  • Members
  • PipPipPipPipPip
  • 502 posts

Posted 17 March 2010 - 05:28 PM

Liz can you meet me here:

Please Login or Register to see this Hidden Content

:)