Okay
  Public Ticket #2619870
Search Query Parameter
Closed

Comments

  •  2
    Jordan started the conversation

    Hi Support,

    I would like to change the theme search query parameter from 's' to 'q' as what Google recommended for Google Analytics.

    I googled around and found to modify the laborator_function.php, search.php and search-results.php;  i tried replacing the "s" with "q" but it didn't work.

    If you have the code just send it to me and i will give it a go.

    Thank you!

    Jordan

  • [deleted] replied

    Hi Jordan,

    Here is the code snippet to do that:

    function wp_change_search_url_request( $request ) {
        if ( isset( $_GET['q'] ) ) {
            $request['s'] = $_GET['q'];
        }
        return $request;
    }
    function wp_change_search_url() {
        if ( is_search() && ! empty( $_GET['s'] ) ) {
            wp_redirect( home_url( "?q=" ) . urlencode( get_query_var( 's' ) ) );
            exit();
        }
    }
    add_filter( 'request', 'wp_change_search_url_request' );
    add_action( 'template_redirect', 'wp_change_search_url' );
    
    I've tested and it worked as you can see in the video below:

    https://d.pr/v/yL8VLV

    I've googled if there is something that is natively supported by WordPress but there were no other ways to do this.

  •  2
    Jordan replied

    It works! Thank you very much!

  • [deleted] replied

    Happy to hear thatsmile.png

    Your question was a customization question and support doesn't offer customization services as we wrote on our support homepage and on this area but I tried to help you this time.

    Have a great week!

    P.S: If you enjoy our theme, you can head over to your Downloads tab and give it 5 stars. We will love you forever.

  •  2
    Jordan replied

    I'm glad that you stretched your support for me.

    I'm happy to give you 5 star.

    just quick question, the theme editor "bakery" it doesn't load properly, just giving me a white screen and nothing happens.

  • [deleted] replied

    Dear Jordan,

    Thank you for your rating, we appreciate it so much.

    Regarding your other issue, may I login to your site and test the issue? For this I will need your credentials of WordPress.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

    Also let me know how can I reproduce the issue of white screen.

  •   Jordan replied privately
  • [deleted] replied

    Hi Jordan,

    I saw the whitescreen and wanted to install latest update of WPBakery but I had no such access, however can you please download latest version of WPBakery here:

    https://d.pr/f/mjAT5M (password Jordan)

    Then install it and it should solve this issue.

  •  2
    Jordan replied

    It works! Thank you so much!

    Just a quick one, Do you have a css to modify the size of the image thumbnail testimonial?

    I would like it to increase a bit to 120px only if possible. Thank you so much again for your amazing support.

    CHeers!

  •  2
    Jordan replied

    Sorry to add it up here but the content is not mobile friendly..

    Can you help me please..

  • [deleted] replied

    Hi Jordan,

    Here is the CSS to increase testimonial picture size to 120px (or whatever size you prefer, +20px for margin):

    .page-container .wpb_content_element.lab_wpb_testimonials .testimonials-inner .testimonial-entry .testimonial-thumbnail {
        width: 140px; /* 120px image size + 20px margin from content */
    }
    
    And the result:

    medium
    (view large image)

    As for responsive issues, I've checked the page and the content (text) is shown properly here:

    medium
    (view large image)

  •  2
    Jordan replied

    It all works now! Thank you so much for your support.

  • [deleted] replied

    Hi Jordan,

    Happy to hear thatsmile.png

    I wish you all the best!

    Will mark this ticket as solved from here.