15% off on any product use coupon "freedom" Need Help Contact us

Search console Error "SearchAction" object must be nested inside a "WebSite" obj


Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #21223

    Hi, I buy and use the theme RepublicPro. Everything is ok but now I have problem with search console that says: “SearchAction” object must be nested inside a “WebSite” object

    How can I solve this error?
    I have the problem only on my websites with RepublicPro Theme!


    This is because search form is above the web body or placed in header.

    just replace search function code in RepublicPro/inc/custom-function.php file Line no 134 to 154

    /* ----------------------------------------------------------------------------------- */
    /* Custom Search Form
    /*----------------------------------------------------------------------------------- */
    function republic_search_form( $form ) {
    	$form = '<form method="get" id="searchform" class="searchform" action="' . esc_url(home_url( '/' )) . '" >
                <div class="row">
                <div class="large-12 columns">
                <div class="row collapse">
                <div class="small-10 columns">
                 <input type="text" placeholder="'.esc_attr(of_get_option('republic_searchplaceholder','Search..')).'" value="' . get_search_query() . '" name="s" id="s" />
                <div class="small-2 columns">
               <i class="fa fa-search"></i><input type="submit" class="button postfix" value="'. esc_attr__( 'Go','republicpro' ) .'" />
    	return $form;
    add_filter( 'get_search_form', 'republic_search_form' );
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.