Customizing search result templates based on post type

  • pridigital
    Participant
    11 months ago #33144

    Hi there,

    I was wondering if there is a way to modify the way search results are presented.

    I’m trying to customize the search result templates based on the post type. Specifically, I would like to render each search result using a different template depending on whether it’s a blog post, a page, or a custom post type.

    As I understand this, it could be accomplished through some sort of action or filter that could be responsible for setting the path to the template… ??? Or having multiple result.twig templates ??? But I’m not sure how I could implement this.

    Could you point me in the right direction?

    Thank you for your time and assistance.

    • This topic was modified 11 months ago by pridigital. Reason: new idea
    pridigital
    Participant
    11 months ago #33149

    I figured it out. This can be done using WordPress templates. Thanks anyway.

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

You must be logged in to reply to this topic.