[resolved] Adding Search Functionality (3 posts)

  1. TrekRight
    Posted 2 years ago #

    Hi Everyone,

    Any recommendations on the best way to add search functionality to my site without using widgets? I don't think there is a shortcode available (by default).

    Is adding a shortcode via PHP the best approach? (easy enough to do, but then I either need to set up a child theme or lose the ability to update Quark).

    Or is there a particular plugin that works well with Quark?

    Other options?

    Thanks in advance for any help.

  2. Anthony Hortin
    Theme Author

    Posted 2 years ago #

    You can add a search form using the following php. Simply add it to wherever you'd like it displayed, such as the sidebar.

    <?php get_search_form(); ?>

    Using the above php, Quark will render the WordPress built-in search form. If you want to customise it, simply create a searchform.php file and add something like the following...

    <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
    		<span class="screen-reader-text">Search for:</span>
    		<input type="search" class="search-field" placeholder="Search …" value="" name="s" title="Search for:" />
    	<input type="submit" class="search-submit" value="Search" />

    You can read more about this on the WordPress Codex.

  3. TrekRight
    Posted 2 years ago #

    Thanks, Anthony - much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic


No tags yet.