Welcome to Rise Forums

Join our fantastic community to connect with like-minded website owners, WordPress users, and online entrepreneurs.

Category/page-level Targeting For Scripts In Wp?

Discussion in 'WordPress Questions & Support' started by Adam Connell, Sep 11, 2016.

Thread Status:
Not open for further replies.
  1. Mmm, that one should work Adam. I've got it installed on a couple of sites, but I'm only using the html footers on posts, not for header scripts or anything, so that I can add a sig and a call to action below posts, and it doesn't show it if I disable it.

    Is it JV code you're adding to the header section in the plugin? If so, I can try adding some random JV code at my end to see if it's working here if you like.
     
  2. It's Javascript so that could be the reason why.

    I'll hunt around and see if any other plugins do it - or I'll table the idea for later.

    Thanks for your help on this, Paul.
     
  3. Note: looks like my original idea of using Plugin Organizer is viable - options can be displayed below posts, but I need to turn them on in the settings.
     
  4. @Adam Connell there is actually a way to do it, but with custom fields (ACF plugin will make it easier).
    Add field where you paste code on posts and pages
    Then you have to add basic call it like that (but might need a bit different code ) to header or footer (you can even add two custom fields):
    PHP:
    <?php if( get_field('field_name') ): ?>
        <p>My field value: <?php the_field('field_name'); ?></p>
    <?php endif; ?>
    If field is empty it won't execute the code
     
  5. Thanks Kris, I'll take a look.
     
Thread Status:
Not open for further replies.

Share This Page