[Support request] Shortcode for the WordPress search form?

Home Forums Support Shortcode for the WordPress search form?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #863641
    Henry

    I’d like to add the generic WordPress search form to a page – my question is – what is the ‘best approach’ for this using GeneratePress? Is there some functions.php code that I is recommended for this?

    function shapeSpace_display_search_form() {
    	return get_search_form(false);
    }
    add_shortcode('display_search_form', 'shapeSpace_display_search_form');

    I found the above – is this ok? Any thoughts?

    GeneratePress 2.2.2
    GP Premium 1.7.8
    #863854
    David
    Staff
    Customer Support

    Hi there,

    looks good to me 🙂

    #865499
    Henry

    Thanks David

    Just to follow up on this – it works great but the styling goes completely weird on smaller screens. I’m sure the CSS can be tidied up.

    On a chrome desktop I just need a little padding as is evident here: https://screencast.com/t/pAPBNlUVZIA

    But on mobile (Chrome, iPhone 7) the submit button adopts gradient sides.

    So – my question is – how do you suggest I go about CSS styling the Vanilla WP search form within GP?

    Thanks!

    #865539
    David
    Staff
    Customer Support

    This CSS should stop the mobile browsers styling:

    .search-form input {
        -webkit-appearance: none;
        -webkit-border-radius: 0;
    }

    How would you like the search to look? You have any examples?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.