Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #259925

    Hi EnSuTeam,

    I love the out-of-the-box share function (share this entry).
    But is there a way to have these share icons on portfolio items and pages ?

    If it’s not possible, i must use a plugin which seems to defeat the idea of a built-in function… ;)

    Thanks for your help.

    #260646

    Hey ouranos3!

    Yes, please try to use this code to insert the buttons at the bottom of portfolio pages/standard pages:

    
    
    add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2);
    function avia_add_social_toolbar($id = "", $context = "")
    {
    	if($context == "page" || $context == "single-portfolio")
    		avia_social_share_links();
    }
    
    

    If you also want to use the social toolbar with template builder pages use this code instead:

    
    add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2);
    function avia_add_social_toolbar($id = "", $context = "")
    {
    	if($context == "page" || $context == "single-portfolio")
    		avia_social_share_links();
    }
    
    add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1);
    function avia_add_social_toolbar_template_builder($content = "")
    {
    	$content .= avia_social_share_links(array(), false);
    	$content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>';
    	return $content;
    }
    

    Best regards,
    Peter

    #260789

    Thanks Peter.

    Code for ALB works fine. That’s perfect.
    Code for Standard WP editor doesn’t work
    I’m using a child theme functions.php for both.

    Here’s in an example with a page with standard WP editor :

    http://586814b516.url-de-test.ws/enfoldsupport/aa_simple_page_without_alb/

    #261011

    Sorry to be pedantic here. Where do I add the code to enable social sharing on pages? I have tried functions.php but it’s not working :(

    This is definetly one to add in the next update ;)

    #261049

    I added the code to functions.php of my child theme.
    The second code block (which adds social share icons to pages and portfolio items made with the AVIA Editor) works fine.
    But the first one, for standard pages, doesn’t work for me.

    #261213

    Hey!

    Please update to Enfold 2.7.1 – the ava_after_content hook is not available in 2.7 or previous theme versions.

    Best regards,
    Peter

    #261250

    Thanks for your accurate support Peter. Works fine.
    Resolved.

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Share icons on pages and portfolio items ?’ is closed to new replies.