Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #166525

    begotauler
    Participant

    Hi!
    I would like to put a social media box inside a page or a widget, such as the ones that appears in the footer. How can I do it?

    #166787

    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Add this code at your child theme’s functions.php

    add_shortcode('social_global', 'x_social_global');

    Then add [social_global] to your text widget.

    Or if you wan’t them added per page content, then add this at your child theme’s functions.php

    add_filter('the_content', 'add_social_global');
    
    function add_social_global ( $content ) {
    return $content.'[social_global]';
    }

    Or if you wish to use social share shortcode https://theme.co/x/member/kb/shortcode-walkthrough-share/ at your text widget.

    Hope this helps.

    #166901

    begotauler
    Participant

    Thanks for your answer.

    I already had a child-theme running. I added code to the child theme’s functions.php, but I can not get it to work.
    What am I doing wrong?

    #166904

    begotauler
    Participant
    This reply has been marked as private.
    #167238

    Friech
    Moderator

    Hi there,

    Please replace the [social_global] on the text widget with this X-shortcode.

    [share title="connect with us" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true"]

    Let us know how it goes. Have a good day/night.

    #167266

    begotauler
    Participant

    Thank you. It´s working now, but the icons give me the option to share the post, and I want the links to go to my social media pages (like the box in the footer). Is it possible to do it?

    Thanks and good night from Spain!!!

    #167619

    Rubin
    Keymaster

    Hey There,

    This option is currently not possible. Although it is possible to change the core function of the shortcode this is outside the scope of support we can provide. One suggestion I can give you is looking for a social plugin that is doing what you need and embed it the same way like our share shortcode. Sorry that I do not have better news and thank you for your understanding.

    #167647

    begotauler
    Participant

    Ok, then I’ll look a plugin.
    In any case, I think it would be good to add that short-code in future updates of the theme.;)
    Thank you very much.

    #167961

    Rad
    Moderator

    Hi there,

    It looks like do shortcode is disabled at your end.

    Could you try add this at your child theme’s functions.php too?

    add_filter('the_content', 'do_shortcode', 9999 );
    add_filter('widget_text', 'do_shortcode', 9999 );
    

    And change this

    add_shortcode('social_global', 'x_social_global');

    to this,

    add_shortcode('social_global', 'x_social_global_buffer'); function x_social_global_buffer ( $atts ) { ob_start(); x_social_global(); return ob_get_clean(); }

    Cheers!

    #168109

    begotauler
    Participant

    Great, it works!!! (You are the best)

    Only two questions more:

    1. How I can edit the css to remove the bottom line on icons and put hover in another color?

    2. When I add the short-code in the content, the icons do not appear, only when I move the mouse over them.

    Thank you very much!!!

    #168113

    begotauler
    Participant
    This reply has been marked as private.
    #168138

    ander
    Participant

    Thanks for the tweaks, as I do with Visual Composer? Thank…

    #168554

    Paul R
    Moderator

    Hi Begotauler,

    For #1

    You can add this under Custom > CSS in the Customizer.

    
    /* to remove underline */
    .x-sidebar .widget .x-social-global a {
        text-decoration:none;
    }
    
    /* to change hover color */
    .x-sidebar .widget .x-social-global a:hover {
        color:red !important;
    }
    

    For #2

    You can add this under Custom > CSS in the Customizer.

    
    /* icon color */
    .x-social-global a {
         color: #62b3db !important;
    }
    
    /* icon hover color */
    .x-social-global a:hover {
         color: red !important;
    }
    

    Change red with the color that you like.

    Hope that helps. 🙂

    #168875

    begotauler
    Participant

    Thank you very much, tt´s perfect!!!

    #168968

    Christopher
    Moderator

    You’re welcome.