WordPress.org

Support

Support » Plugins and Hacks » Jetpack by WordPress.com » [Resolved] Class Jetpack_Likes not found

[Resolved] Class Jetpack_Likes not found

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jeremy Herve

    @jeherve

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

    Thanks!

    @jeremy, even better, the source code is hosted in github 🙂

    https://github.com/brunoamaral/adp

    Plugin Author Jeremy Herve

    @jeherve

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

    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 ! 🙂

    @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. 🙂

    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.

    Plugin Author Jeremy Herve

    @jeherve

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

    Plugin Author Jeremy Herve

    @jeherve

    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' );
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Class Jetpack_Likes not found’ is closed to new replies.
Skip to toolbar