[Resolved] “Nothing was found.”

Home Forums Support [Resolved] “Nothing was found.”

Home Forums Support “Nothing was found.”

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

    Hello,

    I am having problems with the “Nothing was found.” message as soon as I use Elements as content template. Instead of correctly displaying the message “Nothing was found.” in case of an incorrect search, HTML elements from my content-template are being shown.

    The correct variant (without Elements)
    http://vertriebsrecht.de.dedi4088.your-server.de/urteilsbesprechungen/?_suche_besprechungen=xxxxxxxx

    The incorrect variant (with Elements)
    http://vertriebsrecht.de.dedi4088.your-server.de/rechtsprechungen/?_suche_rechtsprechungen=xxxxxxxx

    I want that no “Elements” elements are displayed in case of an unsuccessful search.

    #2295334
    Ying
    Staff
    Customer Support

    Hi David,

    Try this php snippet, replace 2560with your content template element ID.

    add_filter( 'generate_element_display', function( $display, $element_id ) {
    
        global $post;
    
        if ( 2560 === $element_id && is_post_type_archive() && !$post ) {
    
            $display = false;
    
        }
    
        return $display;
    
    }, 10, 2 );
    #2296395
    David

    That helped. Thanks a lot!

    #2296509
    Ying
    Staff
    Customer Support

    You are welcome 🙂

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