Layout problem after WP 5.2 update using LGC and search shortcode
-
This is not a support request. I found a glitch and I’m sharing a workaround:
After running the WP 5.2 update on a few sites using LGC with a search shortcode, I noticed the search form was no longer being output inside LGC. It was being output ABOVE both columns. In other words, the form HTML had been structurally moved ABOVE both of the LGC columns. The column that should contain the form was now empty.
I was using the following code via the child theme functions.php file to create the search shortcode:
add_shortcode('customsearch', 'get_search_form');
I replaced it with a custom search form …like this:
function customsearchform( $form ) { $form = '<form role="search" method="get" id="customsearchform" action="' . home_url( '/' ) . '" > <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label> <input type="text" value="' . get_search_query() . '" name="s" id="s" /> <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" /> </div> </form>'; return $form; } add_shortcode('customsearch', 'customsearchform');
And the form is now being output inside the column again.
I’m still not sure why this is happening; whether it’s specific to LGC or if it’s a WP 5.2 bug. Maybe Tom can shed some light on this.
- The topic ‘Layout problem after WP 5.2 update using LGC and search shortcode’ is closed to new replies.