-
AuthorPosts
-
December 17, 2014 at 11:51 am #166525
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?December 17, 2014 at 9:04 pm #166787Hi 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.
December 18, 2014 at 3:22 am #166901Thanks 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?December 18, 2014 at 3:26 am #166904This reply has been marked as private.December 18, 2014 at 2:55 pm #167238Hi 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.
December 18, 2014 at 3:35 pm #167266Thank 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!!!
December 19, 2014 at 7:32 am #167619Hey 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.
December 19, 2014 at 8:26 am #167647Ok, 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.December 19, 2014 at 7:00 pm #167961Hi 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!
December 20, 2014 at 11:33 am #168109Great, 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!!!
December 20, 2014 at 11:37 am #168113This reply has been marked as private.December 20, 2014 at 2:14 pm #168138Thanks for the tweaks, as I do with Visual Composer? Thank…
December 21, 2014 at 11:23 pm #168554Hi 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. 🙂
December 22, 2014 at 7:28 am #168875Thank you very much, tt´s perfect!!!
December 22, 2014 at 10:12 am #168968You’re welcome.
-
AuthorPosts