Jump to content
Sign in to follow this  
MissT

Add Sharebar to end of post excerpt

Recommended Posts

MissT+    4
MissT

I'd like to add the sharebar to just after the 'Read more' link at the end of a post excerpt on blog page.

 

Do I need to use a hook in the functions.php in order to achieve this or is there another way?  If I do need to add a hook what code do I need to add in addition to...

 

add_action('pagelines_loop_after_excerpt', 'add_end_sharing');
function add_end_sharing() { ?>

 

What goes here!?

<?php }

 

By default the sharing options appear after the post title in the post meta area but I don't like this it looks too cluttered so I'd like to add them at the end of the post instead.

 

Many thanks in advance! :)

Share this post


Link to post
Share on other sites
Rob    547
Rob

Hi,

 

I'd not know the code for Sharebar, and our moderating team are not developers, so you'd need a Pro for that. However, you might be able to use the shortcodes from http://demo.pagelines.me/tools/  I don't recommend using Pinterest there, even with Sharebar as it grabs the post's excerpt and thumb from the post only, not the blog page. The shortcode cannot be set globally for some of them. Facebook is the same, but they do provide some code you can add directly.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
MissT+    4
MissT

This worked in the functions.php of my child theme in case anyone else wants to do the same...

 

add_action('pagelines_loop_after_excerpt', 'add_end_sharing');
function add_end_sharing() {
    echo do_shortcode('[like_button url=http://url-to-like.com]');
    echo do_shortcode('[twitter_button]');
    echo do_shortcode('[pinterest img=url(optional)]');
    
}

Share this post


Link to post
Share on other sites
greenfly    230
greenfly

Thanks for letting us know MissT 


The answer to many issues can be found by searching in the forum before posting as someone else  may very well have had the same problem before you have.  Also, reading the documentation can help you gain a good understanding of how everything works. 

 

Please do not send me private messages. Occam's razor - The principle states "Keep things simple!"

Share this post


Link to post
Share on other sites
Amy E    0
Amy E

This is great.

How might I tweak it if I'm using the full post content on the blog page rather than excerpts?

Thanks,

Amy

Share this post


Link to post
Share on other sites
Rob    547
Rob

Amy you'd have to find the correct hook to replace pagelines_loop_after_excerpt as used by MissT.  Try the Action Map plugin to help you find the correct hook.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×