• Hello,

    Love this theme!
    I see your code snippet on adding a button to the Nav Bar as in the theme demo; however, I need to add a custom button image. To be exact, I need to add code for a custom live chat button that is provided for me by my live chat provider. I think that the Nav Bar where you have the button example in the demo is the best place because of the responsive design.

    My site: kinglocksmiths.com

    How and where can I add the custom code for the chat button so it shows up to the right of the menu items on the nav bar? I will make a custom image that will be the approximate size of the button on the Customizr Demo.

    Thank you,
    Sarah

Viewing 5 replies - 1 through 5 (of 5 total)
  • Various ways. I’d suggest you create a new widget area using this Snippet

    You can then add the code from your provider in the standard Text Widget.

    Then you’ll need to reposition it. To reposition items, you need to start with:

    .selector {
    position: relative;
    top: 0px;
    left: 0%;
    }

    and then make adjustments. Use ‘-‘ to move up or left from start-position so
    top: -1px moves up, 1px moves down
    left: -1% moves left, 1% moves right

    For width dimensions, using % ensures your responsiveness is maintained.

    So you’d need something like:

    .home .my-extra-widget {
    position: relative;
    top: 0px; /* change this vertical */
    left: 0%; /* change this horizontal */
    }

    Thread Starter optymizer

    (@optymizer)

    Thank you!

    How would I get the widget area to show inside the nav bar box? What hook do I use instead of __after_header?

    The snippet shows only an example for placing it under the header.

    Thank you,
    Sarah

    Because you’re repositioning, then I think that hook should work OK, but you could try __navbar (I’m learning with you!)

    Another approach would be through the WP menus and CSS.

    Fist of all, you need to understand how to add classes to the menus in WordPress (explained here and reproduced below):

    1. Go to admin > appearance > menu
    2. Click on Screen Options (top right of the screen)
    3. Check the CSS classes options in the “Show advanced menu properties” panel
    4. add your css classes to the element

    Then choose your menu button and give it the classes:
    custom-live-chat btn btn-mini btn-primary

    You can then style is, as nikeo does here, with something like:

    .navbar .nav li.custom-live-chat.btn {
    position: relative;
    bottom: 6px;
    padding: 2px;
    line-height: 19px;
    vertical-align: middle;
    background: url(http://lorempixel.com/120/32/);
    }
    .navbar .nav li.custom-live-chat.btn a {
    color: #FFF;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.31);
    padding: 3px 13px;
    }

    which will give you your background image.

    The only (perhaps big) issue is whether you can then add your code in the menu or not. If your code is a shortcode, then it should work.

    Thread Starter optymizer

    (@optymizer)

    The chat provider makes you choose from their buttons or upload your own and the code includes the button you pick from the setup. I don’t think it would work… Although it might, I just don’t have the time to try it out.

    My solution: I included the chat code on the site without a button. It just pops up to invite a visitor after 10 seconds. I might just include the button on the contact us page and be done with it.

    Thank you both for your help and I might try this out someday… 🙂

    Sarah

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Button Image in Nav Bar’ is closed to new replies.