Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Maeve Lander, were you able to figure this issue out? We are having a similar issue with a different plugin and I am attempting to track down the root cause.

    Thanks!

    Thread Starter jacobfogg

    (@jacobfogg)

    AHHH… the function to build the form is:

    get_search_form(), which is found in /wp-includes/general-template.php

    It is setting the action by using get_option(‘home’)

    I would suggest the following logic to replace the simpel get_option(‘home’)

    $searchAction = get_option(‘home’);
    if(get_option(‘show_on_front’) == ‘page’){
    $searchAction = get_page_link(get_option(‘page_for_posts’));
    }

    Then when building the form, set the action to $searchAction.

    For now, I am going to just create a custom function in my funcitons.php file and refer to that to build the search box instead of the default one… but it would be nice to see this fixed!

    Should I report this to bugs?

    Thread Starter jacobfogg

    (@jacobfogg)

    WP does recognize https://localhost/blog/?page_id=3&s=test, so a simple redirect might work… but that means a regular express looking for ?s= or &s=…

    OR

    Along the same lines, modify the code so that search forms look to see if the “blog” is the homepage or an alternate page and adjust the printed URL accordingly

    OR

    Maybe I register a filter to look for something like ‘id=”searchform” action=”https://localhost/blog/”‘ and replace it with ‘id=”searchform” action=”https://localhost/blog/?page_id=3″‘

    OR

    Maybe the fix might be as simple as the code somewhere doing a check like:

    if($_REQUEST[‘s’]!=”){//then this is a search

    If that is the case, a change to something more like

    if(isset($_REQUEST[‘s’])){//then this is a search

    Might fix the issue as well.

    These are my ideas, I’m willing to try any of them out… just looking for some direction to make sure I am not wasting my time.

    Thread Starter jacobfogg

    (@jacobfogg)

    I went so far as to install a vanilla wp with an empty db and no themes or plugins. I added a page titled “Blog” and left it empty. Then I went to settings->reading and checked “Static page”, I chose “About” as the Front page and “blog” as the Posts page. Next I went to the blog page (ttp://localhost/blog/?page_id=3) and performed a search for test(https://localhost/blog/?s=test)… no results showed up but it did display the search result page as expected. Next I did a blank search (https://localhost/blog/?s=) and low and behold the “About” page showed up.

    You can’t strip down more than that…

    See no relation to the htaccess change, but Figured I might as well give it a shot… I am testing at this point on a windows box, so I can’t create a .htaccess file… I did however tweak the memory limit in my php.ini file… still no dice.

    I understand why this is happening, the search is defaulting to the wordpress root. It is a bug however that ‘?s=’ displays the static home page.

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