• Resolved bjrnet21

    (@bjrnet21)


    I love your search plugin. I am using the free version on a Twenty-Fourteen theme.

    I use the shortcode [searchform] on some pages which works well.

    I also use the shortcode similar to [searchform post_types=”database”].

    I want to distinguish the displayed search block for the above tool as follows.

    Instead of just “Search…”, I want:

    Search Site…
    OR
    Search Database…

    depending on which shortcode I use.

    Is this possible?

    Thank you for a great plugin.

    • This topic was modified 5 years ago by bjrnet21.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Something like this might work. Add this to your theme functions.php:

    add_filter( 'relevanssi_search_form', 'rlv_change_form_text' );
    function rlv_change_form_text( $form ) {
        $site_or_database = 'Site';
        if ( strpos( $form, 'database' ) !== false ) {
            $site_or_database = 'Database';
        }
        $form = str_replace( 'Search...', "Search $site_or_database...", $form );
        return $form;
    }
    Thread Starter bjrnet21

    (@bjrnet21)

    Thank you so much. I will give it a try.

    Thread Starter bjrnet21

    (@bjrnet21)

    Worked like a charm! You can check the results at: https://www.blackjackreview.com/wp/historical-events/tool/ (middle of the page).

    Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I change “Search…” to “Search Database…” in custom search shortcode?’ is closed to new replies.