How to get a hook to ONLY apply to single posts

Community Forums Forums Design Tips and Tricks How to get a hook to ONLY apply to single posts

This topic is: not resolved

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  meursault 1 year, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #41835

    meursault
    Participant
    Post count: 10

    Hello,

    I currently have the following hook at genesis_before_post:

    [feat-img-left] This [post_terms taxonomy=type before=""] about [post_categories before=""] was originally published by [post_terms taxonomy=writer before=""] at [post_terms taxonomy=publication before=""], and was translated into English by [post_terms taxonomy=translator before=""] on [post_date]. <br>[post_comments]</br>

    It displays as I want it to on single posts, e.g. here. But I only want it to display there, not on pages, category pages, etc.

    How do I do that?

    I imagine the is_singular function is involved, but I’m a PHP illiterate. :(

    Thanks in advance.

    http://russianspectrum.com/
    #41896

    braddalton
    Participant
    Post count: 10675

    You can use and modify code like this in your child themes functions.php file.

    Code not display? Grab it on Github.


    #41901

    meursault
    Participant
    Post count: 10

    Thanks! I’ll try that and see how it goes.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.