WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Class Jetpack_Likes not found (9 posts)

  1. BrunoAmaral
    Member
    Posted 11 months ago #

    I am trying to position the wordpress like button on a different part of http://www.brunoamaral.eu and when I follow the instructions in http://jetpack.me/2013/06/10/moving-sharing-icons/ the script shows an error message of "Class Jetpack_Likes not found".

    As far as I could tell, jetpack is connected to wordpress.com and everything is working as it should. The like button even appears where he is supposed to, in the share-dropdown button and is working.

    I am at a loss here, is there anything else I can to do troubleshoot the issue?

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

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    Could you let me know the exact changes you've made to your theme?

    Thanks!

  3. BrunoAmaral
    Member
    Posted 11 months ago #

    @Jeremy, even better, the source code is hosted in github :)

    https://github.com/brunoamaral/adp

  4. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 11 months ago #

    I just sent you a pull request. Could you have a look at it and let me know if it helps?

  5. BrunoAmaral
    Member
    Posted 11 months ago #

    This is quite strange. I had tried that exact line of code and it wasn't working.

    Right now it all seems to be in order, thank you ! :)

  6. BrunoAmaral
    Member
    Posted 11 months ago #

    @Jeremy, I figured out what the issue was.

    At my development server Jetpack was not linked to wordpress.com, as a result the class for Jetpack Likes wasn't loaded.

    I added a sanity check to your code to make sure this doesn't break the theme.

    if (class_exists('Jetpack_Likes') {
    }

    Thank you again for your help. :)

  7. BrunoAmaral
    Member
    Posted 10 months ago #

    After upgrading to Jetpack 2.5 this solution no longer works. At least not in this particular case.

    I am trying to figure out what exactly changed between 2.4.2. and 2.5 since the class names and hooks used seem to have stayed the same.

  8. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 9 months ago #

    Thanks for the report! I'll look into it and let you know as soon as I have a solution.

  9. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 8 months ago #

    We found the issue, and we updated the blog post accordingly: you will now need to use the following code to remove sharing buttons and Likes from the bottom of your posts:

    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::init(), 'post_likes' ), 30, 1 );
    }
    
    add_action( 'loop_start', 'jptweak_remove_share' );

Reply

You must log in to post.

About this Plugin

About this Topic

Tags