Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

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,092
    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