Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1120348
    coryyeakel
    Participant

    Hey 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!

    #1120351
    coryyeakel
    Participant

    I’ve tried a few different things but nothing has been successful so far.

    #1120713
    Christopher
    Moderator

    Hi there,

    Please remove JS from customizer and add it to specific pages under cornerstone tab/custom javascript.

    Hope it helps.

    #1120987
    coryyeakel
    Participant

    I 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?

    #1121076
    Rupok
    Member

    Hi 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!

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