Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1424116

    Hi

    W really like the AJAX search feature, which display results according to post type. See screen grab.

    Is it possible to search display results on the page in the same way, so users can see which post type a result is from?

    Kind regards

    Duncan

    #1424198

    Hey dweddell,

    Thank you for the inquiry.

    While this is possible, making these modifications falls outside the scope of our support. You can include the post type in the post meta information. Please insert the following code into the functions.php file.

    add_filter('avf_post_metadata_array', function($meta, $context) {
        global $post;
    
        if($context == 'loop-search') {
            $posttype = get_post_type($post->ID);
            $posttypelink = get_post_type_archive_link($posttype);
            $meta['post_type'] = "<a href='{$posttypelink}'>$posttype</a>";
        }
    
        return $meta;
    }, 10, 2);

    Best regards,
    Ismael

    #1424228

    Hi Ismael

    Thanks for your help

    Kind regards

    Duncan

    #1424230

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Search Results layout’ is closed to new replies.