Sure. Thanks a lot for replying too! (sadly I cannot express the problem in more condensed fashion)
I’ve been monkeying with it so a few things have changed, but more or less same problem. I may have figured out the issue. (Code below, pasted from functions file)
#1. This is going to be an image search which taps into a special table.
When the action=’https://www.clipartillustrations.com/?page_id=699‘ … it does not go to link destination (which is image search page which runs the unique image search variables)
Hence I’ve created the rather convoluted script you see here to improvise over different permalink scenerios.
Everything was working as expected until the mysterious problem mentioned at the opening post.
//a get ID by page name function is necessary for our search input buttons...
function m_m_get_page_id($page_name){
global $wpdb;
$page_name = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."'");
$id = $page_name;
return $id;
}
//the main search form...
function m_m_search_form( $form ) {
//Since wordpress users may have differing permalink structures, the permalink to the search page must be retrieved so the <form> "action=whatver_link" can be assigned.
//name of search page...
$page_name = 'search-images';
//get the id of the search page
$id = m_m_get_page_id( $page_name );
//get the permalink of the search page...
$search_permalink = get_permalink( $id );
$is_dynamic = strpos( $search_permalink ,'?' );
if($is_dynamic !== false)
{$page_invis_input = '<input type="hidden" name="page_id" value="'. $id . '" />';
$form_action = home_url( '/' );
} else
{$form_action = $search_permalink; $page_invis_input = ''; }
$form = '<form role="search" method="get" id="searchform" action="' . $form_action . '" >
' . $page_invis_input . '
<input type="text" class="cai_search_box" value="' . get_search_query() . '" name="search" id="s" />
<input type="image" id="searchsubmit" src="' . get_template_directory_uri() . '/images/cai_blank.gif" class="cai_searchbox_submit" value="" />
</form>';
return $form;
}
add_filter( 'get_search_form', 'm_m_search_form' );
?>