Roots Share Buttons with get_the_excerpt()

Hi everyone,

I’ve found a little bug when using: <?php echo get_the_excerpt( $post) ?>, as it can be seen in the attached image:

If I set Roots Share Buttons before the content I get the name of all the social buttons when calling the excerpt, before the excerp text. It doesn’t happen if I use get the content function.

Any ideas to get rid of them?

Thanks a lot!!

I’ll look into this and report back soon!

1 Like

I’ve used get_the_content() trimmed, so no hurry. And thanks a lot for the quick response @ben.

Hey Iban,

Open up roots-share-buttons/lib/buttons.php and in the buttons function (Line 58), remove lines 63 and 65:

ob_start(); + return ob_get_clean();

So that it looks like:

function buttons($args = array()) {
  if (is_feed()) {
    return;
  }

  include(apply_filters('roots/share_template', ROOTS_SHARE_PATH . '/templates/shortcode-share.php'));
}

Let me know if that works for you. I want to look into this a little bit more before releasing a new version

Sorry @ben, I am currently having some personal issues and I cannot work for the moment.

Thank you for your reply and I will do that change in short. Propably next week. I’ll tell you how it works.

I really appreciate your job with Roots, you guys have changed the way I used to work developing sites. And I thank you for that.