Search results problem

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20828
    Dezio
    Dezio
    Participant

    Hello,
    After the last update appears a problem on showing results.
    http://www.dezio.it/oli-essenziali/

    Before the update I used this code in functions.php to print:

    – thumbnail
    – title on the page
    – botanical name (post_tag)

    just these 3 elements.

    //Code
    add_filter( ‘asp_results’, ‘asp_add_tags_to_content’, 1, 1 );
    function asp_add_tags_to_content( $results ) {
    $taxonomy = “post_tag”;

    foreach ($results as $k=>$v) {
    if ( $v->content_type != ‘pagepost’) continue;

    // Get the post terms
    $post_terms = wp_get_object_terms( $results[$k]->id, $taxonomy );
    $cats = array();
    if ( !empty($post_terms) && !is_wp_error($post_terms) ) {
    // Concatenate category names to the $cats variable
    foreach($post_terms as $c){
    $cats[] = $c->name;
    }
    }

    // Modify the post title
    if ( !empty($cats) )
    $results[$k]->content .= “Nome Botanico: “.implode(‘, ‘, $cats);
    }

    return $results;
    }

    //

    like this old post: https://wp-dreams.com/forums/topic/problem-on-indexing-post/

    Now it show all the [fusion_builder] code.
    How can I fix it?

    Regards
    Dezio

    #20841
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Dezio,

    Thank you for all the details, I think I have found the issue. The description field was missing for some reason, I have re-entered it to this field here. Now it should be all right.

    I will investigate this further on the test environments to make sure it does not happen again in upcoming releases. Sorry about the inconvenience.

    Best,
    Ernest Marcinko

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


    #20850
    Dezio
    Dezio
    Participant

    Ok great, thank you.
    It lost during update, but I don’t know why.

    Thanks!

    #20864
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.