• Resolved musicletter

    (@musicletter)


    Hello.

    We would like to replace the “Search Form WP” module with “Google Search”, or rather with this code.

    How can we simply make sure that by clicking on the “Search” button on the site’s homepage, the correctly formatted and functioning box appears?

    We did this but it is not displayed/formatted correctly…

    This the site: [ Link moved to link field ]

    Thank you
    The staff

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

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter musicletter

    (@musicletter)

    Well, tomorrow we will try to add it in the CSS which is in the edit menu of our theme, the same place where we put the previous code. We will keep you updated. A thousand and more thanks

    Thread Starter musicletter

    (@musicletter)

    Hi @zoonini, we tried putting your code in our theme’s additional CSS, but the size of the search box is still the same.

    Moderator Kathryn Presner

    (@zoonini)

    Hi @zoonini, we tried putting your code in our theme’s additional CSS, but the size of the search box is still the same.

    I don’t see any CSS added at Appearance > Customize > Additional CSS. Could you please try adding it to the CSS editor in this spot, and saving it?

    Thread Starter musicletter

    (@musicletter)

    Ciao. This is the current code

    h2.entry-title, h1.entry-title {
    font-size: 4.5rem !important;
    }
    .post-meta-wrapper {
    margin-top: 0px !important;
    margin-bottom: unset !important;
    }
    .post-inner {
    padding-top: 035px!important;
    } .post-separator.styled-separator.is-style-wide.section-inner {
    margin-top: 035px;
    margin-bottom: 035px;
    }
    .featured-media {
    margin-top: 0.5rem !important;
    }
    .wp-block-image.size-large.is-resized {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
    }
    .singular .entry-header {
    padding: 2rem 0 !important;
    }
    body:not(.singular) main > article:first-of-type {
    padding: 1rem 0 0 !important;
    }
    .archive-header {
    padding: 2rem 0 !important;
    }
    .entry-header {
    padding-top: 10px !important;
    } function wpspecial_rimozione_prefisso_categoria( $title ) {
    if ( is_category() ) {
    $title = single_cat_title( '', false );
    }
    return $title;
    }
    add_filter( 'get_the_archive_title', 'wpspecial_rimozione_prefisso_categoria' ); div[id*="___gcse"] {
    width: 100%;
    margin: 2rem 0;
    } .gsc-search-box tr,
    .gsc-search-box td,
    .gsc-search-box table {
    border: none !important;
    } .gsc-search-box table {
    margin: 0;
    } td.gsc-search-button {
    width: revert;
    padding: 0;
    }

    This is the modified code which produces no change in the search box.

    h2.entry-title, h1.entry-title {
    font-size: 4.5rem !important;
    }
    .post-meta-wrapper {
    margin-top: 0px !important;
    margin-bottom: unset !important;
    }
    .post-inner {
    padding-top: 035px!important;
    }
    
    .post-separator.styled-separator.is-style-wide.section-inner {
    margin-top: 035px;
    margin-bottom: 035px;
    }
    .featured-media {
    margin-top: 0.5rem !important;
    }
    .wp-block-image.size-large.is-resized {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
    }
    .singular .entry-header {
    padding: 2rem 0 !important;
    }
    body:not(.singular) main > article:first-of-type {
    padding: 1rem 0 0 !important;
    }
    .archive-header {
    padding: 2rem 0 !important;
    }
    .entry-header {
    padding-top: 10px !important;
    }
    
    function wpspecial_rimozione_prefisso_categoria( $title ) {
    if ( is_category() ) {
    $title = single_cat_title( '', false );
    }
    return $title;
    }
    add_filter( 'get_the_archive_title', 'wpspecial_rimozione_prefisso_categoria' );
    
    div[id*="___gcse"] {
    width: 100%;
    margin: 2rem 0;
    }
    
    .gsc-search-box tr,
    .gsc-search-box td,
    .gsc-search-box table {
    border: none !important;
    }
    
    .gsc-search-box table {
    margin: 0;
    }
    
    td.gsc-search-button {
    width: revert;
    padding: 0;
    }
    .gsib_a { width: 2000px; }
    Moderator Kathryn Presner

    (@zoonini)

    You have some PHP code mixed in with your CSS code. PHP cannot run in a CSS file, and it also prevents code below it from working correctly.

    function wpspecial_rimozione_prefisso_categoria( $title ) {
    if ( is_category() ) {
    $title = single_cat_title( '', false );
    }
    return $title;
    }
    add_filter( 'get_the_archive_title', 'wpspecial_rimozione_prefisso_categoria' );
    

    You’ll need to move that PHP function into the Code Snippets plugin (or a child theme)

    If that still doesn’t work, please follow my instructions here for where to place the code.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘How to replace “Search Form WP” with “Google Search”’ is closed to new replies.