• Resolved AndreasJa

    (@andreasja)


    Hi!

    Thanks for the plugin, just what i was looking for πŸ™‚

    I only have one problem.

    Is it possible to display number of shares in a posts meta-data?

    For example on my homepage, at the bottoms of my posts, i have “Written by, time, date” etc.

    Anyway to display “xx” shares there too?

    thx

    https://ww.wp.xz.cn/plugins/social-shares/

Viewing 1 replies (of 1 total)
  • Thread Starter AndreasJa

    (@andreasja)

    I think i solved it. It works, but i dont know if its the right way to do it.

    I used this code in my index.php where i wanted the “XX shares” to display.

    <?php $meta_values = get_post_meta( $id, 'shares', true ); ?> 
    
    <?php if ( get_post_meta( $id, 'shares', true ) ) : ?>
      <?php echo get_post_meta ( $id, 'shares', true ) . ' shares';?>
    <?php endif; ?>
Viewing 1 replies (of 1 total)

The topic ‘Display in a Posts meta-data?’ is closed to new replies.