Tagged: x
-
AuthorPosts
-
March 24, 2016 at 3:04 pm #851489
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 .= ‘‘;
$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
March 24, 2016 at 6:11 pm #851690Hi 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 credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
March 24, 2016 at 6:26 pm #851711This reply has been marked as private.March 24, 2016 at 10:24 pm #851887Hi 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!
March 24, 2016 at 11:18 pm #851937Actually, that wasn’t what I was asking. I wanted the Donate button on the same line as the logo.
March 24, 2016 at 11:51 pm #851976Hi 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!
March 25, 2016 at 1:45 am #852065Thanks much, got it.
March 25, 2016 at 1:47 am #852066We’re delighted to assist you with this.
Cheers!
-
AuthorPosts