-
AuthorPosts
-
May 27, 2014 at 7:20 pm #270732
Is it possible to place the social share options for some pages (like the option for posts)?
Best
NedimMay 27, 2014 at 7:21 pm #270734Hi nedimhazar!
Please refer to Peter’s post here – https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/#post-260646
Cheers!
YigitMay 27, 2014 at 8:30 pm #270779Thanks 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.phpadd_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;
}May 27, 2014 at 8:42 pm #270786Hey!
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,
JosueMay 27, 2014 at 9:23 pm #270810Thanks 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,
NedimMay 27, 2014 at 9:24 pm #270812Make sure you are writing the quotes right, normally when you paste a code the ascii characters ("e..) come up and break the code.
We looking forward to hearing from you Nedim :)
Regards,
JosueMay 30, 2014 at 12:01 pm #272346Hi, 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?
May 30, 2014 at 12:10 pm #272350Hi!
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,
YigitMay 30, 2014 at 12:23 pm #272360Hi 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
May 30, 2014 at 7:23 pm #272539Hey!
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,
JosueMay 30, 2014 at 10:12 pm #272610Hi 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
May 30, 2014 at 10:15 pm #272614Hi,
Can you please create me an administrator account? post it here as a private reply.
Regards,
JosueMay 30, 2014 at 10:21 pm #272619This reply has been marked as private.May 30, 2014 at 10:26 pm #272623You forgot the URL.
May 30, 2014 at 10:28 pm #272624This reply has been marked as private.May 30, 2014 at 10:32 pm #272626Could you make functions.php writable (777)? so i can edit it directly from here:
May 30, 2014 at 10:39 pm #272632This reply has been marked as private.May 30, 2014 at 10:47 pm #272634That depends on the FTP client you use:
http://codex.wordpress.org/Changing_File_Permissions
http://www.siteground.com/tutorials/ftp/ftp_chmod.htm
http://buddingbloggers.com/2009/04/changing-file-permissions-via-filezilla/Best regards,
JosueMay 30, 2014 at 10:58 pm #272639This reply has been marked as private.May 30, 2014 at 11:03 pm #272643No problem, looking forward to hearing from you :)
Regards,
JosueMay 30, 2014 at 11:05 pm #272645This reply has been marked as private.May 30, 2014 at 11:08 pm #272647This reply has been marked as private.May 30, 2014 at 11:19 pm #272650This reply has been marked as private.May 30, 2014 at 11:21 pm #272651This reply has been marked as private.May 30, 2014 at 11:22 pm #272653You are welcome, glad we could help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Share option for pages in enfold?’ is closed to new replies.