Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1298086
    DonWattz
    Participant

    Hello,

    I have a Parent Page called “Shop” and there are children pages under it called “Apparel” etc… How can I target the children pages so that the logo is different on those pages only.

    I am already using this code
    jQuery(".home .x-brand img").attr("src","IMAGE HERE");
    to change the logo on certain pages.

    #1298089
    Christian
    Moderator

    Hey there,

    A child page has a body class of page-child and also has the ID of its parent parent-pageid-1821 so you could target specific children or a page.

    Thanks.

    #1298100
    DonWattz
    Participant

    That worked great. I have it targeting the child pages but it is not showing on the actual parent page. Any solution for that?

    #1298104
    Joao
    Moderator

    Hi Don,

    You should add the ID of this page also.

    Can you send the url of the page where it is not working and a page that it is working?

    Thanks

    #1298130
    DonWattz
    Participant

    jQuery(".parent-pageid-331,.page-id-331 .x-brand img").attr("src","IMAGE HERE");

    The website is not live. I tried this code above but it didn’t work either.

    #1298150
    Thai
    Moderator

    Hi There,

    Please try with this code instead:

    jQuery(".page-id-123 .x-brand img,.page-id-331 .x-brand img").attr("src","IMAGE HERE");

    123 is the shop page ID and 331 is the apparel page ID.

    Hope it helps!

    #1298171
    DonWattz
    Participant

    Thank you.

    I used this code
    jQuery(".woocommerce .x-brand img, .parent-pageid-331 .x-brand img").attr("src","IMAGE HERE");

    and it worked. Thank you.

    #1298180
    Joao
    Moderator

    Glad to hear it,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1298086 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>