Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #270732

    Is it possible to place the social share options for some pages (like the option for posts)?
    Best
    Nedim

    #270734

    Hi nedimhazar!

    Please refer to Peter’s post here – https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/#post-260646

    Cheers!
    Yigit

    #270779

    Thanks for the tip Yigit. It works but it goes on all pages. Is there a way of choosing where it can be put?
    By the way I put the second coding into functions-enfold.php

    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;
    }

    #270786

    Hey!

    Try changing this part:

    function avia_add_social_toolbar($id = “”, $context = “”)
    {
    if (is_page(array(1,2,3,4,5)){
    if($context == “page” || $context == “single-portfolio”)
    avia_social_share_links();
    }
    }

    Change 1,2,3,4,5 by the Pages ID where you want to include the share module.

    Best regards,
    Josue

    #270810

    Thanks Josue, I’ll continue tomorrow. While copying your code, the whole site broke and I had to load the original functions.enfold.php. I’m just too tired now. I’ll let you know :)
    Best,
    Nedim

    #270812

    Make sure you are writing the quotes right, normally when you paste a code the ascii characters (&quote..) come up and break the code.

    We looking forward to hearing from you Nedim :)

    Regards,

    Josue

    #272346

    Hi, I am trying to do something similar. The code provided works great but I would like to target the portfolio entries only to show the share icons and not on the pages. how can I isolate it to show just for the portfolio entries and not pages?

    #272350

    Hi!

    Please add following code to Functions.php file in Appearance > Editor

    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();
    }
    

    Regards,
    Yigit

    #272360

    Hi Yigit Thanks for the quick reply, I added that to my child theme functions.php and it does not come up. If I add all the code given then it appears but also on the pages which is what I don’t want. the code also only shows up if I add all of it nothing shows up if I add just that segment.

    Thanks J

    #272539

    Hey!

    I tested the code in my local install and it worked fine (only portfolio) as long as i didn’t use the ALB, if you are using the ALB for your portfolio items you’d need to change the code to:

    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;
    }

    Best regards,
    Josue

    #272610

    Hi Josue, thanks for reply. I tried that but still coming up on the pages as well as portfolio not sure what I’m doing wrong.

    Regards J

    #272614

    Hi,

    Can you please create me an administrator account? post it here as a private reply.

    Regards,
    Josue

    #272619
    This reply has been marked as private.
    #272623

    You forgot the URL.

    #272624
    This reply has been marked as private.
    #272626

    Could you make functions.php writable (777)? so i can edit it directly from here:

    #272632
    This reply has been marked as private.
    #272634
    #272639
    This reply has been marked as private.
    #272643

    No problem, looking forward to hearing from you :)

    Regards,

    Josue

    #272645
    This reply has been marked as private.
    #272647
    This reply has been marked as private.
    #272650
    This reply has been marked as private.
    #272651
    This reply has been marked as private.
    #272653

    You are welcome, glad we could help :)

    Regards,
    
Josue

Viewing 25 posts - 1 through 25 (of 25 total)
  • The topic ‘Share option for pages in enfold?’ is closed to new replies.