Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #1205276
Targeting portfolio single pages - functions.php
Closed

Comments

  • BaptisteJesu started the conversation

    Hi,

    I'd like to load my custom js file only on portfolio single pages (single-thegem_pf_item).

    How can I target those in functions.php ? I tried "is_singular('portfolio') or is_single('portfolio') but it didn't work.

    Thanks

    Baptiste

  •  7,280
    Oliver replied

    HI!

    Example:

    <?php if (get_post_type() == 'thegem_pf_item') { code } ?>
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • BaptisteJesu replied

    Thank you Gregor !

  •   Oliver replied privately