- This topic has 7 replies, 3 voices, and was last updated 2 years, 8 months ago by David.
-
AuthorPosts
-
July 10, 2021 at 6:38 pm #1851319Miguel
Hi GP Team,
I inserted the native GeneratePress “search form” inside the “Elements -> Block Element -> Element Type -> Right Sidebar”. I’m using the Search Form “Shortcode” after adding this code with the help of the “Pluginception” plugin:
add_shortcode( ‘search_form’, function() {
ob_start();
get_search_form();
return ob_get_clean();
} );Here the URL of my Testing Website so that you can see the Issue –> https://playwp.xyz/
Thanks for your kind help 🙂
July 10, 2021 at 9:59 pm #1851384LeoStaffCustomer SupportHi there,
Why not just use a search widget as a right sidebar widget?
Let me know 🙂
July 11, 2021 at 12:23 am #1851421MiguelHi Leo,
Thanks for your reply. Of course, I tried the WordPress Native “Search Widget” but I don’t like its styling and overall appearance. For that reason I want to use the GeneratePress own Search Box, so that I can keep a more coherent and harmonious design/appearance. Using the WordPress “Search Widget” gives me a disjointed visual appearance.
July 11, 2021 at 3:47 am #1851542DavidStaffCustomer SupportHi there,
that shortcode is getting the WP Search Form – its not a GP Function.
The Search Widget should generate the exact same output, except it will have the correct markup that formats the layout.Can you add a search widget to the sidebar as well so i can see whats happening ?
July 11, 2021 at 11:13 am #1852024MiguelHi David,
Thanks for your reply. Yes, I already added the “Search Widget Block” to the sidebar. In the testing website right sidebar you will see both, the “GP Styled Search Form” and the “Native WordPress Search Widget”. Here the URL of my Testing Website so that you can see –> https://playwp.xyz/
Also below, in the Private information area I leave the testing website Login Details in case you want to see my “Elements -> Block Element -> Element Type -> Right Sidebar” where I have added the “GP Styled Search Form shortcode” First, and the “WordPress Search Widget Blocks” Second.
I used the plugin “Pluginception” to create a plugin/file named “GeneratePress Custom Code”. In that file I have added the PHP code for calling the shortcode.
I can’t increase the “Right Sidebar” width to fix the issue. I need to use the current width.
July 12, 2021 at 2:05 am #1852486DavidStaffCustomer SupportAah ok – yes the core Search Block, for some crazy reason WP didn’t give the choice to use the default Search form that the theme styles.
Add this CSS to make your shortcode match GP:
.search-form { display: flex; } .search-form input[type=search] { width: 100%; }
July 12, 2021 at 9:08 pm #1853589MiguelHi David,
The CSS code provided works like a charm. The issue is fixed now.
Thank you very much for your help.
July 13, 2021 at 2:57 am #1853796DavidStaffCustomer SupportGlad to be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.