Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #296276

    Hi

    I am trying to create pages that have the Share Icons Box and then the Comments Box at the end of the page
    I insert this code on the functions.php file of my Enfold Child Theme, so i can select Share icons and Comments from the Adavance Layout Builder:

    ——————————————————————————————————————————————————————–

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

    ———————————————————————————————————————————————————-

    But it doesn´t work
    What can i do?

    Paulo

    #297323

    Hi hamiltonbuchanan!

    Unfortunately you can’t add the social icons between two template builder elements. You can only append it at the very bottom of the page. However you can remove the “Comments” element from the template and use this modified function:

    
    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>';
    	$content .= do_shortcode('[av_comments_list]');
    	return $content;
    }
    

    to display the comments template below the social icons. You can see the results here: http://hiperatividade.pt/hiper/

    Regards,
    Peter

    #297427

    Hi Peter

    Yes, i thing this will work.
    Thank you for your help

    Paulo

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Share Icons Box Before Comments’ is closed to new replies.