Support » Plugins » No Homepage after add_filter in functions.php

  • James Hall


    I wanted to add Google Adsense Search to a new site so, I made a /search-results page and pasted in the code. The iFrame was way too big so I looked for an option to set a single page with a different layout. I found this (wrong) code to place at the end of my functions.php:

    add_filter('genesis_pre_get_option_site_layout', 'streamline_home_layout');
    function streamline_home_layout($layout) {
        if ( is_page('search-results') )
             $layout = 'full-width-content';
        return $layout;

    It worked and my search page was full width but now every “Home” link takes you to the “Search Results” page like index.php has been unhooked? I removed the code from functions file and I tried to reset the homepage with no luck, and also tried “remove_filter(‘genesis_pre_get_option_site_layout’, ‘streamline_home_layout’);” but as you might have guessed, I’m not too good at PHP…just enough to be dangerous.

    I looked in the sql db dump file for the page url but “.com/search-results” is found about 10 times and it looks like its in serialized strings so I don’t want to search and replace just yet. The site is working for every page but domain root index. I placed a redirect temporarily and its working but looks like instead of just .com/. Is there an easy way to undo this mess I made or am I starting over?

  • The topic ‘No Homepage after add_filter in functions.php’ is closed to new replies.