Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    I recommend creating a filter, which hooks to this one:

    apply_filters('asl_result_content_after_prostproc', $r->content, $r->id);

    This hook point provides a way to access the content after post-processing along with the post ID.
    Sample usage:

    add_filter( 'asl_result_content_after_prostproc', 'asl_add_some_meta', 1, 2 );
    
    function asl_add_some_meta( $content, $post_id ) {
      $some_meta = get_post_meta( $post_id, 'meta_key_here', true );
      return $content . " - ".$some_meta;
    }

    So basically this filter function gets a meta tag by name ‘meta_key_here’ and appends it to the content.

    In the file includes/search_content.class.php you can find many other filters that might be useful for you.

    Best regards,
    Ernest Marcinko

Viewing 1 replies (of 1 total)
  • The topic ‘how to add meta data to search result’ is closed to new replies.