Tagged: x
-
AuthorPosts
-
December 19, 2016 at 7:18 am #1298086
DonWattzParticipantHello,
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.December 19, 2016 at 7:26 am #1298089
ChristianModeratorHey there,
A child page has a body class of
page-childand also has the ID of its parentparent-pageid-1821so you could target specific children or a page.Thanks.
December 19, 2016 at 7:32 am #1298100
DonWattzParticipantThat worked great. I have it targeting the child pages but it is not showing on the actual parent page. Any solution for that?
December 19, 2016 at 7:39 am #1298104
JoaoModeratorHi 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
December 19, 2016 at 7:58 am #1298130
DonWattzParticipantjQuery(".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.
December 19, 2016 at 8:21 am #1298150
ThaiModeratorHi 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!
December 19, 2016 at 8:32 am #1298171
DonWattzParticipantThank 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.
December 19, 2016 at 8:38 am #1298180
JoaoModeratorGlad to hear it,
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1298086 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
