This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Adding CPT Slug to Result

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35379
    Jugro22630Jugro22630
    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 MarcinkoErnest 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}]

    #35381
    Jugro22630Jugro22630
    Participant

    Thanks for the quick answer!

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

    #35382
    Ernest MarcinkoErnest 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

    #35392
    Jugro22630Jugro22630
    Participant

    Sorry, blind sometimes.

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

    #35399
    Ernest MarcinkoErnest 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.