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

Search results problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20828
    DezioDezio
    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 MarcinkoErnest 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.

    #20850
    DezioDezio
    Participant

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

    Thanks!

    #20864
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

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