Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #320831

    Hello I want to add some custom social buttons at the bottom and top of each post and page.Where do I implement the code for that?

    Facebook requires two additional steps to work properly. Add this XML namespace to the <html> tag of your website:
    <html xmlns:fb=”http://ogp.me/ns/fb#”&gt;

    <div class=”share-buttons share-buttons-fb-like” data-style=”button_count”></div>
    <div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
    <div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
    <div class=”share-buttons share-buttons-pinterest” data-style=”none”></div>

    Thanks!

    #320969

    Hi gentlemansgazette!

    Thank you for using Enfold.

    I’m not sure where to put the code but you can use the following plugins to add social buttons:

    https://wordpress.org/plugins/socialize/
    https://wordpress.org/plugins/wp-socializer/

    Cheers!
    Ismael

    #324385

    Isamel,

    I do want to use my own for tracking purposes…
    We have already implemented the script via Tag Manager, and now the div is all we need to display the buttons.

    #324810

    Hi!

    You can use the ava_after_content hook, try this code in functions.php:

    function custom_func($context) {
    if($context == 'post'){
    ?>
    social links here
    <?php
    }
    }
    add_action('ava_after_content', 'custom_func', 10, 1);
    

    Cheers!
    Josue

    #338524

    It’s not working :(

    #338557

    Hi,

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

    Regards,
    Josue

    #340355
    This reply has been marked as private.
    #340407

    Hi!

    Can you enable file editing? or provide a FTP account so we can edit the child theme files.

    Cheers!
    Josue

    #341655
    This reply has been marked as private.
    #341700

    Hey!

    It works now, i left this code in your child functions.php:

    function custom_func($id, $context) {
    if($context == 'post'){
    ?>
    
    <div>
    	SOCIAL LINKS HERE
    </div>
    
    <?php
    }
    }
    add_action('ava_after_content', 'custom_func', 10, 2);

    Best regards,
    Josue

    #341738

    Thanks. I added the links where it says social links here but they are not showing up…

    <div class=”share-buttons share-buttons-fb-like” data-style=”button_count”></div>
    <div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
    <div class=”share-buttons share-buttons-tweet” data-style=”horizontal”></div>
    <div class=”share-buttons share-buttons-pinterest” data-style=”none”></div>

    #341784

    Hey!

    They are showing up now, the quotes you put were wrong, i fixed it on your child functions.php.

    Regards,
    Josue

    #341792

    Great, thanks! Now they are just in the wrong position. I would like them to show up right underneath the heading of each article see the screenshot. How do I do that?
    Social Buttton Location

    #341793

    screenshot

    #341797

    Hey!

    Unfortunately there is no hook available at that location, you’d need to directly edit the includes/loop-index.php theme file. I’ve already done that, the social links are now appearing at the desired location.

    Alternatively you can copy single.php and includes/loop-index.php to your child theme installation so this modification gets preserved on theme update.

    Best regards,
    Josue

    #341820

    Will do, thank you so much!

    #341827

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 17 posts - 1 through 17 (of 17 total)
  • You must be logged in to reply to this topic.