[Resolved] Hooks on pages & single posts

Home Forums Support [Resolved] Hooks on pages & single posts

Home Forums Support Hooks on pages & single posts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #372805
    imraan-ftg

    I am looking to achieve following:

    1) I need a section above copyright (footer) on all the pages except post page.

    I added a hook under > After Footer widget and the content is visible. However, its getting displayed on all the pages including single posts

    See > http://myprintscreen.com/s/mlbs/0589a662de

    2) Need a image (ad section) between post content and comments on single post.

    I added a hook under > After Content and the content is visible. However, its getting displayed on all the pages (site wide)

    See > http://myprintscreen.com/s/mlbt/b29a158237

    #372826
    Leo
    Staff
    Customer Support

    Hi there,

    1) Try this:

    <?php if ( ! is_single() ) { ?>
        Content in all pages except (!) single post pages
    <?php } ?>

    2) Try this:

    <?php if ( is_single() ) { ?>
        Content in all single post pages
    <?php } ?>

    Make sure execute PHP is checked. More info on conditional tags here: https://codex.wordpress.org/Conditional_Tags

    #372847
    imraan-ftg

    Thats awesome

    #372889
    Leo
    Staff
    Customer Support

    Yup it is 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.