Tagged: x
-
AuthorPosts
-
August 6, 2016 at 1:30 pm #1120348
coryyeakelParticipantHey guys,
I currently have a couple Javascript functions in the Global Customizer to display my title and social buttons above my featured image.
However, on a new post I’m making, I want the featured image to display first, so I’m wondering if it’s possible to exclude a specific Post ID from these global Javascript functions? If not, is there any other code I can add to this specific Post to make it work?
Here’s the JS from my Global Customizer:
jQuery( function($) { $('.single-post .entry-header').insertBefore('.single-post .entry-featured'); } ); jQuery( function($) { $('.single-post .nc_socialPanel').insertBefore('.single-post .entry-featured'); } );Thanks in advance for the help!
August 6, 2016 at 1:32 pm #1120351
coryyeakelParticipantI’ve tried a few different things but nothing has been successful so far.
August 7, 2016 at 3:13 am #1120713
ChristopherModeratorHi there,
Please remove JS from customizer and add it to specific pages under cornerstone tab/custom javascript.
Hope it helps.
August 7, 2016 at 11:06 am #1120987
coryyeakelParticipantI have over 100 posts, and like I said, I only need the exception on this specific post ID. Is there not an easier way to do this than going back through every single post and adding the JS to each one individually?
August 7, 2016 at 1:12 pm #1121076
RupokMemberHi there,
Thanks for writing back. It would be a bit tricky. You can try updating the code like this :
jQuery( function($) { $('.single-post .entry-header').insertBefore('.single-post:not(.postid-123) .entry-featured'); } ); jQuery( function($) { $('.single-post .nc_socialPanel').insertBefore('.single-post:not(.postid-123) .entry-featured'); } );Let’s update the postid-123 with your post ID that you want to exclude.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1120348 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
