Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #335379

    Hello, I am interested in showcasing the same social media sharing icons that appear at the bottom of post entries on the portfolio entries as well.

    How can I do this?

    Thanks!

    #335458

    Hey momon!

    Thank you for using Enfold.

    You can use this on functions.php:

    add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2);
    function avia_add_social_toolbar($id = "", $context = "")
    {
    	if($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;
    }

    Cheers!
    Ismael

    #335637

    Thank you! it seems to work but it is showing up at the very bottom of the page which isn’t ideal on my current page setup. While I might be able to work around that it would be ideal if there was a way I could target the links to show up at a specific location? is there any way to do that?

    Additionally I just noticed that the code is being applied everywhere (on all pages) including the homepage which isn’t ideal. Is there any way to limit it to portfolio items?

    Thanks.

    • This reply was modified 10 years, 2 months ago by momon.
    #337578

    Hey!

    The share links can be included either before the post content or after, to make them appear only portfolio items change the code to this:

    add_filter('avf_template_builder_content', 'avia_add_social_toolbar_template_builder', 10, 1);
    function avia_add_social_toolbar_template_builder($content = "")
    {
    if(is_singular('portfolio')){
    	$content .= avia_social_share_links(array(), false);
    	$content .= '<div style="height:1px; margin-top:50px;" class="hr"></div>';
    }
    return $content;
    }

    Regards,
    Josue

    • This reply was modified 10 years, 2 months ago by Josue.
    #337602

    Sorry sir, your code above seems to break my homepage completely. It strips out the entire content area of the homepage.

    #337609

    I edited the snippet, try it again.

    Best regards,
    Josue

    #337611

    That seems to have worked. Thank you.

    #337614

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Social media sharing icons on portfolio entries’ is closed to new replies.