Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #651630

    I have been fixing bugs for a client with the Enfold theme since the latest WP update. My last fix is the social share buttons. The current code fix puts the buttons on the bottom every page. I don’t want/need them on every page. I originally had them isolated to “portfolio items ” and “posts” but the update messed that up. I need a code update or css work around.

    I am using the following code from another post in my the functions-enfold.php file.

    // add social toolbar to pages & builder pages
    add_action(‘ava_after_content’, ‘avia_add_social_toolbars’, 10, 2);
    function avia_add_social_toolbars($id = “”, $context = “”)
    {
    if($context == “page” || $context == “single-portfolio” || $context == “product”)
    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 .= ‘<div id=”custom_share_box” class=”avia-section main_color container_wrap”><div class=”container”>’;
    $content .= avia_social_share_links(array(), ”, ”, false);
    $content .= ‘</div></div>’;
    return $content;
    }

    #652481

    Hey Boris,

    Thank you for using Enfold.

    Could you please provide a link to the page where we can see the issue? This code should be enough to render the social share buttons:

    // add social toolbar to pages & builder pages
    add_action('ava_after_content', 'avia_add_social_toolbars', 10, 2);
    function avia_add_social_toolbars($id = "", $context = "")
    {
    if($context == "page" || $context == "single-portfolio" || $context == "product")
    avia_social_share_links();
    }

    For pages, created with the advance layout builder, use this:

    add_filter('avf_template_builder_content', 'avf_template_builder_content_social_mod', 10, 1);
    function avf_template_builder_content_social_mod($content = "")
    {
    	ob_start();
    	avia_social_share_links(array(), false);
    	$social = ob_get_clean();
    	$content = $content . $social;
    
    	return $content;
    }
    

    Best regards,
    Ismael

    #653375

    Ismael,

    Thank you for the timely response. I was not aware that Kriesi updated and included the social buttons in the layout builder for the Enfold theme. The code I provided was used before that was an option. I should have investigated a little more before crying wolf. Regardless, I was able to fix the issue. Sorry to have wasted your time. Thank you again.

    Sincere Regards

    #653444

    Hi,

    It’s not a problem. Glad you were able to fix the issue and feel free to reach out to us again if you need anything else.

    Best regards,
    Jordan

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Share Buttons On Every Page???’ is closed to new replies.