Social sharing button only blog post

Hi there, I like to implement on my blog post “social sharing button” - How can I do this?
Thanks for your kind support
Walter

Hi Walter,

Please setup a child theme first:

Then add the following code under functions.php file locates in your child theme:

function x_add_social_sharing() {
	echo do_shortcode('[x_share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]');
}
add_action('x_before_the_content_end', 'x_add_social_sharing');

Hope it helps :slight_smile:

Great Thank you - I have installed the child theme - where do I find the functions.php
KR
Walter

Hi there found it (appearance/Theme editor)
When I enter the code I get the information that there are 16 errors - which need to be corrected!!
What should I do?

Hi Walter,

There are 2 ways to edit the functions.php file:

  • Login to your FTP account then navigates to wp-content/themes/x-child/ you will find the functions.php file.

  • Login to your WordPress dashboard navigate to Appearance > Theme Editor > select X Child Theme > then edit the functions.php file

Hope it helps :slight_smile:

Hi,

Can you please share us a screenshot that shows the error messages?

Thank you.

was my fault - didn´t select “theme-funktions”

Is there also a chance to change the style of the buttons ?

Thank you for your professional great help.

Walter

Hey Walter,

Yes, it is possible by adding some custom CSS but it depends what kind of changes do you want to apply to the social buttons.

Please note that providing custom codes is part of custom development which goes beyond the scope of our support but kindly let us know what kind of styling you want to be added to the social icons so that we can provide suggestions.

Thank you.

Thank you Jade,
thats off course a never ending story of possibiliies - Do you have any examples or pages to get an idea about the styling ? Where would you look?
Thank you
Have a great day
Walter

Hi Walter,

Our apologies but we will not be able to provide possible solutions if you do not know how you want the social icons to appear. The support we offer is limited to questions about the theme features and bug reports and not a consultation for the site design.

Kindly take time to search around how you want the social icons to appear and we can help you by providing suggestions on how to achieve that look.

Thank you.

Thanks for this… is there a way for me to add this above the content? I have created a custom post template in my child theme - “VIEWS/RENEW/CONTENT.PHP”…I would love to add this by inserting some code into this custom template, that way I could place it where I want it.

Also, is there a way to limit this to ONLY blog posts? I do not want it on pages.

Thanks!

Hi @coloradodesigngroup,

In this case, please change your content.php file to this:

<?php

// =============================================================================
// VIEWS/RENEW/CONTENT.PHP
// -----------------------------------------------------------------------------
// Standard post output for Renew.
// =============================================================================

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  <div class="entry-wrap">
    <?php x_get_view( 'renew', '_content', 'post-header' ); ?>
    <?php if ( has_post_thumbnail() ) : ?>
      <div class="entry-featured">
        <?php x_featured_image(); ?>
      </div>
    <?php endif; ?>
    <?php if(is_singular( 'post' )) echo do_shortcode('[x_share title="Share this Post" facebook="true" twitter="true" google_plus="true" linkedin="true" pinterest="true" reddit="true" email="true"]'); ?> 
    <?php x_get_view( 'global', '_content' ); ?>
  </div>
</article>

Next time, you should create a separated ticket that help us to serve you better.

Thank you.

Thank you! Next time i will start a new post.

You’re welcome, Andrew.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.