Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #851489

    sjhpbuyer
    Participant

    I am using a stacked masthead. I would like a donate button to to right of the logo at the top.This is what I have in Function.php now:

    // Add Donation Button
    //============================================================//

    add_filter(‘wp_nav_menu_items’,’add_donate_button’, 99999, 2);

    function add_donate_button( $items, $args ) {

    if( $args->theme_location == ‘primary’ ){
    $items .= ‘<li class=”menu-item menu-item-search”>’;
    $items .= ‘Donate Button‘;
    $items .= ‘‘;
    }

    return $items;

    What’s happening is the donation button is going in the part with the navigation links…it going below not in the same line as the stacked logo.

    Once I get it on the correct line, I can move it around with CSS

    #851690

    John Ezra
    Member

    Hi there,

    Thanks for writing in! The code snippet you have specifies it to be added to the menu. You will need to add the donate button another way. Would you mind telling us how the button works? Will it take you to a page or does it trigger a script? Please provide us more detail so we can tailor our advice. Also, please provide us with login credentials so we can take a closer look. To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #851711

    sjhpbuyer
    Participant
    This reply has been marked as private.
    #851887

    Rupok
    Member

    Hi there,

    Thanks for writing back. I can see this on your site – http://prntscr.com/ajobbv

    So it seems working fine as expected but it’s breaking on smaller screen because there is not enough space.
    You can add this under Custom > CSS in the Customizer.

    @media only screen and (min-width: 980px) and (max-width: 1230px) {
    
    .x-navbar-inner .x-container.max {
      max-width: 95%;
      width: 95%;
    }
    }
    
    @media only screen and (min-width: 980px) and (max-width: 1130px) {
    
    .x-navbar .desktop .x-nav > li > a:not(.x-btn-navbar-woocommerce) {
      padding-left: 10px;
      padding-right: 10px;
    }
    }

    Hope this helps.

    Cheers!

    #851937

    sjhpbuyer
    Participant

    Actually, that wasn’t what I was asking. I wanted the Donate button on the same line as the logo.

    #851976

    Friech
    Moderator

    Hi There,

    Sorry for the confusion. Please navigate to your child theme’s \x-child\framework\views\global\ directory and create a file named _brand.php then paste the code below on it.

    <?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="paypal-btn">
    <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YB42UTTZLMDVL"><img alt="Donate Button" src="http://www.bustersvisionregistry.org/wp-content/uploads/2016/01/donate-now31.png" width="92" height="34" /></a>
    </div>

    You can utilize the class paypal-btn to position your button.

    Hope it helps, Cheers!

    #852065

    sjhpbuyer
    Participant

    Thanks much, got it.

    #852066

    Friech
    Moderator

    We’re delighted to assist you with this.

    Cheers!