Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1350518
    tashitendrel
    Participant

    Good day,

    I have added an icon to the topbar, just next to social media, using _topbar.php as desribed in this link: https://community.theme.co/forums/topic/adding-contact-link-beside-social-media-icons/. So the .php in the child theme looks like that:

    <?php

    // =============================================================================
    // VIEWS/GLOBAL/_TOPBAR.PHP
    // —————————————————————————–
    // Includes topbar output.
    // =============================================================================

    ?>

    <?php if ( x_get_option( ‘x_topbar_display’ ) == ‘1’ ) : ?>

    <div class=”x-topbar”>
    <div class=”x-topbar-inner x-container max width”>
    <?php if ( x_get_option( ‘x_topbar_content’ ) != ” ) : ?>
    <p class=”p-info”><?php echo x_get_option( ‘x_topbar_content’ ); ?></p>
    <?php endif; ?>
    <?php x_social_global(); ?>
    </div>
    </div>

    <?php endif; ?>

    We happy with it, however on smaller screens Facebook icon moves nicely to the center of the screen, while newly added icon keeps to the right according to html code. How can I make it move together with social media icons?

    website: dharmaebooks.org

    thank you

    #1350541
    Thai
    Moderator

    Hi There,

    Please add the following CSS:

    @media (max-width: 979px){
        #top > header > div.x-topbar > div > a {
            float: none !important;
            max-width: 24px;
            display: block;
            margin-left: auto !important;
            margin-right: auto !important;
            margin-bottom: 15px !important;
        }
    }

    Hope it helps 🙂

    #1350542
    Paul R
    Moderator

    Hi,

    Please remove _topbar.php and add the code below in your child theme’s functions.php file.

    
    function x_social_global() {
    
        $facebook    = x_get_option( 'x_social_facebook' );
        $twitter     = x_get_option( 'x_social_twitter' );
        $google_plus = x_get_option( 'x_social_googleplus' );
        $linkedin    = x_get_option( 'x_social_linkedin' );
        $xing        = x_get_option( 'x_social_xing' );
        $foursquare  = x_get_option( 'x_social_foursquare' );
        $youtube     = x_get_option( 'x_social_youtube' );
        $vimeo       = x_get_option( 'x_social_vimeo' );
        $instagram   = x_get_option( 'x_social_instagram' );
        $pinterest   = x_get_option( 'x_social_pinterest' );
        $dribbble    = x_get_option( 'x_social_dribbble' );
        $flickr      = x_get_option( 'x_social_flickr' );
        $github      = x_get_option( 'x_social_github' );
        $behance     = x_get_option( 'x_social_behance' );
        $tumblr      = x_get_option( 'x_social_tumblr' );
        $whatsapp    = x_get_option( 'x_social_whatsapp' );
        $soundcloud  = x_get_option( 'x_social_soundcloud' );
        $rss         = x_get_option( 'x_social_rss' );
    
        $output = '<div class="x-social-global">';
    
          if ( $facebook )    : $output .= '<a href="' . $facebook    . '" class="facebook" title="Facebook" target="_blank"><i class="x-icon-facebook-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $twitter )     : $output .= '<a href="' . $twitter     . '" class="twitter" title="Twitter" target="_blank"><i class="x-icon-twitter-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $google_plus ) : $output .= '<a href="' . $google_plus . '" class="google-plus" title="Google+" target="_blank"><i class="x-icon-google-plus-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $linkedin )    : $output .= '<a href="' . $linkedin    . '" class="linkedin" title="LinkedIn" target="_blank"><i class="x-icon-linkedin-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $xing )        : $output .= '<a href="' . $xing        . '" class="xing" title="XING" target="_blank"><i class="x-icon-xing-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $foursquare )  : $output .= '<a href="' . $foursquare  . '" class="foursquare" title="Foursquare" target="_blank"><i class="x-icon-foursquare" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $youtube )     : $output .= '<a href="' . $youtube     . '" class="youtube" title="YouTube" target="_blank"><i class="x-icon-youtube-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $vimeo )       : $output .= '<a href="' . $vimeo       . '" class="vimeo" title="Vimeo" target="_blank"><i class="x-icon-vimeo-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $instagram )   : $output .= '<a href="' . $instagram   . '" class="instagram" title="Instagram" target="_blank"><i class="x-icon-instagram" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $pinterest )   : $output .= '<a href="' . $pinterest   . '" class="pinterest" title="Pinterest" target="_blank"><i class="x-icon-pinterest-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $dribbble )    : $output .= '<a href="' . $dribbble    . '" class="dribbble" title="Dribbble" target="_blank"><i class="x-icon-dribbble" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $flickr )      : $output .= '<a href="' . $flickr      . '" class="flickr" title="Flickr" target="_blank"><i class="x-icon-flickr" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $github )      : $output .= '<a href="' . $github      . '" class="github" title="GitHub" target="_blank"><i class="x-icon-github-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $behance )     : $output .= '<a href="' . $behance     . '" class="behance" title="Behance" target="_blank"><i class="x-icon-behance-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $tumblr )      : $output .= '<a href="' . $tumblr      . '" class="tumblr" title="Tumblr" target="_blank"><i class="x-icon-tumblr-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $whatsapp )    : $output .= '<a href="' . $whatsapp    . '" class="tumblr" title="Whatsapp" target="_blank"><i class="x-icon-whatsapp" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $soundcloud )  : $output .= '<a href="' . $soundcloud  . '" class="soundcloud" title="SoundCloud" target="_blank"><i class="x-icon-soundcloud" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $rss )         : $output .= '<a href="' . $rss         . '" class="rss" title="RSS" target="_blank"><i class="x-icon-rss-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
     $output .= '<a href="#" target="_blank" rel="nofollow"><img src="http://dharmaebooks.org/wp-content/uploads/2016/07/Adarsha-logo-green.png"></a>';
        $output .= '</div>';
    
        echo $output;
    
      }
    

    Hope that helps.

    #1350543
    tashitendrel
    Participant

    Thank you very much! I does help and the icon moves to the center, however under the Facebook icon. Is there a way to have them next to each other?

    #1350562
    Paul R
    Moderator

    Hi,

    Would you mind providing 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

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

    #1350573
    tashitendrel
    Participant
    This reply has been marked as private.
    #1350582
    Paul R
    Moderator

    Hi,

    Please replace the code provided with this.

    
    function x_social_global() {
    
        $facebook    = x_get_option( 'x_social_facebook' );
        $twitter     = x_get_option( 'x_social_twitter' );
        $google_plus = x_get_option( 'x_social_googleplus' );
        $linkedin    = x_get_option( 'x_social_linkedin' );
        $xing        = x_get_option( 'x_social_xing' );
        $foursquare  = x_get_option( 'x_social_foursquare' );
        $youtube     = x_get_option( 'x_social_youtube' );
        $vimeo       = x_get_option( 'x_social_vimeo' );
        $instagram   = x_get_option( 'x_social_instagram' );
        $pinterest   = x_get_option( 'x_social_pinterest' );
        $dribbble    = x_get_option( 'x_social_dribbble' );
        $flickr      = x_get_option( 'x_social_flickr' );
        $github      = x_get_option( 'x_social_github' );
        $behance     = x_get_option( 'x_social_behance' );
        $tumblr      = x_get_option( 'x_social_tumblr' );
        $whatsapp    = x_get_option( 'x_social_whatsapp' );
        $soundcloud  = x_get_option( 'x_social_soundcloud' );
        $rss         = x_get_option( 'x_social_rss' );
    
        $output = '<div class="x-social-global">';
        $output .= '<a href="#" target="_blank" rel="nofollow"><img width="24" src="http://dharmaebooks.org/wp-content/uploads/2016/07/Adarsha-logo-green.png"></a>';
          if ( $facebook )    : $output .= '<a href="' . $facebook    . '" class="facebook" title="Facebook" target="_blank"><i class="x-icon-facebook-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $twitter )     : $output .= '<a href="' . $twitter     . '" class="twitter" title="Twitter" target="_blank"><i class="x-icon-twitter-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $google_plus ) : $output .= '<a href="' . $google_plus . '" class="google-plus" title="Google+" target="_blank"><i class="x-icon-google-plus-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $linkedin )    : $output .= '<a href="' . $linkedin    . '" class="linkedin" title="LinkedIn" target="_blank"><i class="x-icon-linkedin-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $xing )        : $output .= '<a href="' . $xing        . '" class="xing" title="XING" target="_blank"><i class="x-icon-xing-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $foursquare )  : $output .= '<a href="' . $foursquare  . '" class="foursquare" title="Foursquare" target="_blank"><i class="x-icon-foursquare" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $youtube )     : $output .= '<a href="' . $youtube     . '" class="youtube" title="YouTube" target="_blank"><i class="x-icon-youtube-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $vimeo )       : $output .= '<a href="' . $vimeo       . '" class="vimeo" title="Vimeo" target="_blank"><i class="x-icon-vimeo-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $instagram )   : $output .= '<a href="' . $instagram   . '" class="instagram" title="Instagram" target="_blank"><i class="x-icon-instagram" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $pinterest )   : $output .= '<a href="' . $pinterest   . '" class="pinterest" title="Pinterest" target="_blank"><i class="x-icon-pinterest-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $dribbble )    : $output .= '<a href="' . $dribbble    . '" class="dribbble" title="Dribbble" target="_blank"><i class="x-icon-dribbble" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $flickr )      : $output .= '<a href="' . $flickr      . '" class="flickr" title="Flickr" target="_blank"><i class="x-icon-flickr" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $github )      : $output .= '<a href="' . $github      . '" class="github" title="GitHub" target="_blank"><i class="x-icon-github-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $behance )     : $output .= '<a href="' . $behance     . '" class="behance" title="Behance" target="_blank"><i class="x-icon-behance-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $tumblr )      : $output .= '<a href="' . $tumblr      . '" class="tumblr" title="Tumblr" target="_blank"><i class="x-icon-tumblr-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $whatsapp )    : $output .= '<a href="' . $whatsapp    . '" class="tumblr" title="Whatsapp" target="_blank"><i class="x-icon-whatsapp" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $soundcloud )  : $output .= '<a href="' . $soundcloud  . '" class="soundcloud" title="SoundCloud" target="_blank"><i class="x-icon-soundcloud" data-x-icon="" aria-hidden="true"></i></a>'; endif;
          if ( $rss )         : $output .= '<a href="' . $rss         . '" class="rss" title="RSS" target="_blank"><i class="x-icon-rss-square" data-x-icon="" aria-hidden="true"></i></a>'; endif;
     
        $output .= '</div>';
    
        echo $output;
    
      }
    

    You may change # in this line of code

    $output .= '<a href="#" target="_blank" rel="nofollow"><img width="24" src="http://dharmaebooks.org/wp-content/uploads/2016/07/Adarsha-logo-green.png" /></a>';

    when your link is ready.

    Hope that helps.

    #1350601
    tashitendrel
    Participant

    Thank you. Can I adjust top margin in this line as well? Like that:

    $output .= ‘‘;

    #1350626
    Paul R
    Moderator

    Hi,

    I went ahead and fix the alignment.

    
     $output .= '<a href="#" target="_blank" rel="nofollow"><img style="height:24px;" src="http://dharmaebooks.org/wp-content/uploads/2016/07/Adarsha-logo-green.png"></a>';
    

    Kindly check in your end.

    #1364304
    tashitendrel
    Participant

    Dear Paul,

    thank you very much for this support. I had to remove the function adding the logo icon temporarily, because that link will take longer to launch. So now I have left only facebook page icon in the right top corner. And I have a funny situation, because I cannot see that facebook icon on ipad. To be precise I can see it only on “introduction” page, but not on any other pages and posts. It kind of disappears. What could cause this?

    #1364306
    tashitendrel
    Participant

    Ok, sorry, it took a while to update I guess. Now looks fine. thank you.

    #1364445
    Rahul
    Moderator

    Glad to hear it!

    Let us know if we can help with anything else.

    Thanks!

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