Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #418244

    Gday Enfold users

    I’d like to remove the sidebar from search results page.

    I am aware this can be done by modifying the header.php file ()https://kriesi.at/support/topic/how-to-remove-sidebar-on-search-result-page/, or even by using the CSS display none.

    However, I’m keen to use my child theme function.php file instead, and am wondering if this is possible, and can anyone can help me achieve this.

    cheers

    Darryl

    #418444

    Hi itchybrain!

    Thank you for coming back.

    You have to open enfold\search.php (parent theme).

    Look for (line 8):

    
    get_header();
    

    and replace with:

    
    get_header();
    do_action( 'ava_search_after_get_header' );
    

    This will be implemented in the next update.

    In functions.php of the child theme add:

    
    add_action( 'ava_search_after_get_header', 'my_ava_search_after_get_header', 10 );
     
     function my_ava_search_after_get_header()
     {
    	global $avia_config;
    	 
    	$avia_config['layout']['current'] = $avia_config['layout']['fullsize'];
    	$avia_config['layout']['current']['main'] = 'fullsize';
    	
     }
    

    Cheers!
    Günter

    #419030

    Günter, you’re a legend! Thank you, very much appreciated. Works like a charm.
    cheers
    Darryl

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Function to remove sidebar on search results’ is closed to new replies.