Adding CPT Slug to Result

This topic contains 5 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35379
    Jugro22630
    Jugro22630
    Participant

    Hey there,

    I’m using Ajax Search Pro and I wonder if there’s a way to include CPT slugs.

    For example, I have a CPT called cakes with /cakes slug.

    Can I show that in a search result? e.g. Brownies – Cakes?

    Cheers,
    Julien

    #35380
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Julien,

    Via the advanced title and content fields, you can print the post type name via the __post_type pseudo variable.

    In your case the advanced title field could be something like:
    {titlefield}[ - {__post_type}]

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35381
    Jugro22630
    Jugro22630
    Participant

    Thanks for the quick answer!

    Is there a list with all variables that can be used?

    #35382
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure! They are listed in the first paragraph of the documentation on the link in my previous answer: https://i.imgur.com/H5qHbjQ.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #35392
    Jugro22630
    Jugro22630
    Participant

    Sorry, blind sometimes.

    Anyways, do you plan on integrating GA4 event tracking anytime?
    Plugin’s awesome so far.

    #35399
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you very much!

    Search event tracking is already integrated. It works on both GA4 and the older gtag and universal event trackers.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.