WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Moving Jetpack's "Like" button (11 posts)

  1. blogjunkie
    Member
    Posted 1 year ago #

    Hi, I followed your instructions here and put this code in my functions.php

    add_action( 'loop_end', 'jptweak_remove_share' );
    function jptweak_remove_share() {
        remove_filter( 'the_content', 'sharing_display',19 );
        remove_filter( 'the_excerpt', 'sharing_display',19 );
        remove_filter( 'the_content', array( 'Jetpack_Likes', 'post_likes' ), 30, 1 );
    }

    Then I edited single.php to display the share and Like buttons where I wanted them - after the categories and tags. This works great with the sharing buttons, but it seems that the Like button is not being removed from the_content.

    Here is an example: http://blogjunkie.net/?p=3926

    The Like button appears above and below the categories and tags. Only 1 of the buttons work, the other is stuck at Loading...

    What's the correct filter to apply to remove the Likes button please? Thanks

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Could you try using the following code to remove the existing Likes?

    remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );

    I have also updated our instructions.

    Thanks!

  3. blogjunkie
    Member
    Posted 1 year ago #

    That's great, it worked. Thanks Jeremy! Really appreciate you guys going through the forums and helping people like me :)

  4. BrunoAmaral
    Member
    Posted 10 months ago #

    I have been trying this exact code but for some reason I get the message saying "Class Jetpack_Likes not found".

    Any ideas what could be the issue?

  5. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 10 months ago #

    @BrunoAmaral Could you check that Jetpack is properly activated and connected to WordPress.com, and that you've activated the Like buttons under Settings > Sharing in your dashboard?

    If you still experience issues, Could you please start your own thread, and let me know your site URL there so I can have a closer look?
    http://wordpress.org/support/plugin/jetpack#postform

    Thank you!

  6. BrunoAmaral
    Member
    Posted 10 months ago #

    @Jeremy, thank you I did just that.

  7. FilipeOS
    Member
    Posted 7 months ago #

    Hi Jeremy,

    I've done what this ( instructions say but is still showing 2 Like boxs, your code don't remove it from the content

    Please help,
    Thanks

    Best regards

  8. blogjunkie
    Member
    Posted 7 months ago #

    @FelipeOS I changed loop_end to loop_start and that fixed it for me.

  9. FilipeOS
    Member
    Posted 7 months ago #

    @blogjunkie THANKS!

  10. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 7 months ago #

    @blogjunkie Thanks! I've updated the blog post.

  11. BrunoAmaral
    Member
    Posted 7 months ago #

    I was trying to solve this for days. Thank you! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic