Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1016233
    belayachimarouane
    Participant

    Hello,

    I have searched the forum but there is no solution to what I am trying to do.

    I want to add a search bar next to the logo in the stacked option. What I intend to do is to align the logo to the left and search bar to the right, like in the image I have attached to this thread.

    any directions on how to achieve this ? Thanks a lot.

    #1016235
    belayachimarouane
    Participant
    This reply has been marked as private.
    #1016257
    Thai
    Moderator
    This reply has been marked as private.
    #1016268
    belayachimarouane
    Participant
    This reply has been marked as private.
    #1016309
    Paul R
    Moderator

    Hi,

    Thank you for providing your login credentials.

    To achieve that, create file _brand.php in wp-content/themes/x-child/framework/views/global and copy the code below into that file.

    
    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_BRAND.PHP
    // -----------------------------------------------------------------------------
    // Outputs the brand.
    // =============================================================================
    
    $site_name        = get_bloginfo( 'name' );
    $site_description = get_bloginfo( 'description' );
    $logo             = x_make_protocol_relative( x_get_option( 'x_logo' ) );
    $site_logo        = '<img src="' . $logo . '" alt="' . $site_description . '">';
    
    ?>
    
    <?php echo ( is_front_page() ) ? '<h1 class="visually-hidden">' . $site_name . '</h1>' : ''; ?>
    
    <a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>" title="<?php echo $site_description; ?>">
      <?php echo ( $logo == '' ) ? $site_name : $site_logo; ?>
    </a>
    
    <div class="search-bar">
        <?php get_search_form(); ?>
    </div>
    

    After that, add this in Appearance > Customize > Custom > Edit Global CSS

    
    
    .search-bar {
        max-width: 300px;
        float: right;
    }
    
    .x-logobar {
        text-align:left;
        margin-top:28px;
    }
    

    Hope that helps.

    #1016638
    belayachimarouane
    Participant

    Hello,

    I have tried all these; but no success. I can’t see the search bar.

    Thanks a lot

    #1016679
    Jade
    Moderator

    Hi there,

    Thanks for writing back. I have tested the code provided previously and it seems to be working fine.

    Kindly make sure that you login through FTP and add the _brand.php with the code above to wp-content/themes/x-child/framework/views/global.

    If you have done it but the search bar is still not visible, kindly provide us with your FTP details so that we could check why it is not working on your setup.

    Thank you.

    #1016695
    belayachimarouane
    Participant
    This reply has been marked as private.
    #1016809
    Jade
    Moderator

    Hi there,

    There seems to be a problem when you created the file. I have added the correct one and when you check you site, the search bar should be visible by now. Kindly double check.

    Thank you.

    #1016872
    belayachimarouane
    Participant

    Thats great thanks a lot!

    #1016934
    Jade
    Moderator

    You’re most welcome.

  • <script> jQuery(function($){ $("#no-reply-1016233 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>