Background Color of Parent Page Persisting Thru Sub-Level Pages

resolved (9 posts) (2 voices)

  1. TDR_ent16
    Member

    MySite Team:

    I cannot find the styling to keep the Parent page background on while in the sub-level pages. I'd like, for example, to have my blog's parent a: link maintain a background while viewing a post in the blog. No can do right now. I use #primary_menu li.current_page-item a for the top-level parent pages but don't have something like "#primary_menu li.current_menu_ancestor a" for the sub-menus. Any ideas are appreciated.

    Regards,
    TDR

    Posted 4 months ago #
  2. Elliott
    Support

    Hello TDR_ent16,

    Go ahead and send us a link to your site and take a screenshot highlighting the areas your having issues with so we can get a better idea of what's going on.

    Posted 4 months ago #
  3. TDR_ent16
    Member

    Elliott:

    Here's two screen captures of what I'm talking about.

    I am developing locally and don't have the site at my ISP yet. I think, though, you'll get the gist of what I am looking for with the CSS styling and all.

    Thanks for taking a look at this.

    Regards, TDR

    Attachments

    1. NAVmenu_#2.gif (89.2 KB, 0 downloads) 4 months old
    2. NAVmenu_#1.gif (84.7 KB, 0 downloads) 4 months old
    Posted 4 months ago #
  4. Elliott
    Support

    Are you using the Wordpress menus? If so you should be able to style it like so,

    .jqueryslidemenu > ul > .current_page_parent, .jqueryslidemenu > ul > .current_page_ancestor, .jqueryslidemenu > ul > .current_page_item, .jqueryslidemenu > ul > li > a:hover, .jqueryslidemenu > ul > li:hover > a { background-color: black; }

    Posted 4 months ago #
  5. TDR_ent16
    Member

    Elliott:

    Your suggestion appears to be working when "regular" sub-menu pages are selected. I cannot get blog posts to maintain the background color on the top-level "blog" parent, yet. If you have an idea for that let me know. Otherwise, after I bring the site up at the ISP next week I'll take another look and let you know.

    Regards,
    TDR

    Posted 4 months ago #
  6. Elliott
    Support

    For the top level you would do this,

    .jqueryslidemenu .current-menu-item { background-color: black; }

    Posted 4 months ago #
  7. TDR_ent16
    Member

    Elliott | Support Team:

    I've been working on these suggestions; most work with a little alteration to the pseudo code. I've been unable to get the Blog background (see screen capture above) to stay on when I'm viewing a blog post. Yes, your breadcrumbs work but I like the parent blog menu link background staying on while reading a blog post. I have seen this menu feature in another framework I use. I don't have to create CSS or place PHP code in functions.php file, etc. so it's probably a code snippet somewhere. The challenge, if there is one, is the navigation menu looks at blog posts as being outside of the navigation menu ULs. Perhaps there's some pseudo code styling you could suggest or something else.

    I sent Elliott a PM with user and password to my website at my ISP. I'd appreciate your thoughts.

    Thanks, TDR

    Posted 4 months ago #
  8. Elliott
    Support

    Try pasting this on line 10 in /wp-content/themes/[your_theme]/single.php.

    <script type = 'text/javascript'>
    jQuery(document).ready(function(){
    jQuery('#menu-item-29 a').css({ "background-color" : "tan" });
    });
    </script>
    Posted 3 months ago #
  9. TDR_ent16
    Member

    Elliott:

    It works like a charm; P-E-R-F-E-C-T-O.

    I take it from the code that I should be able to add other '#menu-item-XX a' below the 'menu-item-29 a' and it would also provide the background; makes sense? Anyway, this is the effect I am looking for. Am I to assume your team feels that because blog posts are outside of the menu group that CSS was not possible? BTW, code changes work with single.php in child folder, too.

    I left a duplicate msg via PM.

    Thanks, Elliott

    TDR

    Posted 3 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme