• Resolved hhuskies

    (@hhuskies)


    I have the following hook/code that I’m trying to display ONLY on post type pages. Currently, with the current rendition of this code – it shows the hook on posts, pages AND the home page. I just want it to show up on the posts. Is there a variable and if statement I can use to fix this? Thanks!

    <?php function custom_ad1() { ?>
    code here
    <?php }
    add_action(‘thesis_hook_after_post’, ‘custom_ad1’, ‘1’);
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • place it only in single.php or whatever your post php is called and get rid of the code in index and page.php.

    Thread Starter hhuskies

    (@hhuskies)

    Naturally – I would do it this way – but I’m trying to stay standard & correct by using the custom folder in Thesis. The above code is placed into custom_functions.php folder – and then the code is hooked using the thesis_hook_after_post command.

    Everything works perfectly – I just need to come up with a variable and if statement that understands whether I’m on the home page, a post, or a page.

    Example:
    if on $post –> then show the following code

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Show Hook ONLY on Post – Not Pages’ is closed to new replies.