Title: CPT with Jetpack &#8220;like&#8221; function
Last modified: May 1, 2020

---

# CPT with Jetpack “like” function

 *  Resolved [rick9004](https://wordpress.org/support/users/rick9004/)
 * (@rick9004)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/)
 * Have a CPT called “review” and works fine with all other plugins and theme functions
   except for Jetpack’s “like” function. I added “publicize” to that types “Custom
   Supports” per notes to do so.
 * When I take the same actual post from a review CPT and add it as a normal Post
   type and display it, the “likes” work fine. It does not when it is a CPT.
 * I have replaced my theme with another theme and with no modifications it fails
   the same way ( so it is not my theme ) Also it fails on my test system which 
   is exactly the same as the live one except for HTTPS.
 * Any suggestions?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12765013)
 * Hard to say what may be going on here, without at least seeing the templates 
   being used for your post types. We don’t do anything that’d prevent these features
   from showing up on content types registered with our plugin, so I have to believe
   the issue is at the template level.
 * I’m looking at the Jetpack source code and to the best of my ability to see, 
   it should be getting added to the `the_content` and `the_excerpt` filters. If
   your templates in question aren’t using those at all, explicitly or implicitly,
   then I could see them not showing up.
 *  Thread Starter [rick9004](https://wordpress.org/support/users/rick9004/)
 * (@rick9004)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12765483)
 * Thanks.. I switched to WordPress’s 2020 theme and the same issue occurs. I also
   looked at Jetpack’s code and I too see nothing that prevents it. I looked again
   at Jetpacks sharing features.
 * Check this out [https://jetpack.com/support/publicize/](https://jetpack.com/support/publicize/)
   Is the code below consistent with your plugin? see the area called: How to use
   Publicize with your Custom Post Types
 * I can let you access my test site if you are interested. I’d need to remove the
   security, ( I use 2fa ) etc and get you a user/password.
 * Alternatively I can try to add Jetpack’s code to your plugin on a temporary basis
   to test it.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12765916)
 * I managed to recreate the issue on a local copy…the issue is that I wasn’t able
   to add support fro the post type away from that “Custom supports” section either,
   so I’m not completely sure it’s a CPTUI issue as a whole.
 * On a whim, see if `define('IS_WPCOM', true );` added to your wp-config helps 
   at all. It seems that the filtering is wrapped in that being true.
 *     ```
       $this->in_jetpack = ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ? false : true;
       ```
   
 *     ```
       if ( $this->in_jetpack ) {
       	add_filter( 'the_content', array( &$this, 'post_likes' ), 30, 1 );
       	add_filter( 'the_excerpt', array( &$this, 'post_likes' ), 30, 1 );
       } 
       ```
   
 * Worth a tinkering shot.
 *  Thread Starter [rick9004](https://wordpress.org/support/users/rick9004/)
 * (@rick9004)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12766362)
 * I’ll give it a try. BTW I tested another CPT plugin Pods – Custom Content Types
   and Fields and it works with the same text in a new post type “test”
 * I tried the define(‘IS_WPCOM’, true ); and it totally killed the post display.
   It only displayed a few lines then stopped. When I turned on debug I saw that
   it threw this error: Fatal error: Uncaught Error: Call to undefined function 
   get_blog_details() in /var/www/html/wp-content/plugins/jetpack/modules/likes.
   php
 * My guess is that somewhere in your code the “publicize” is not getting to Jetpack.
   Is there any other way to turn that on?
 * Thanks a lot for your help.. It is not many authors that actually respond like
   you.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12766472)
 * I’m really not sure what’s going on with this.
 * I haven’t made any changes around this in a long time and the code matches what
   their documentation shows what it should be, for the at registration time version.
 * For my testing, I was using their docs page’s Post types sections, and even tried
   with the add_post_type_support() function away from CPTUI and it didn’t work 
   there either. So I don’t feel it’s exclusive to CPTUI
 *  Thread Starter [rick9004](https://wordpress.org/support/users/rick9004/)
 * (@rick9004)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12768806)
 * I asked Jetpack the same support question but they were not really interested
   in finding an answer (I wasn’t using one of their themes, etc.) I suspect that
   they are doing some things that are breaking at times under certain conditions.
   I’m not overly impressed with Jetpack.
 * I may try writing a simple plugin/test harness to test the Jetpack functionality
   and see what happens.
 * So… I’ll continue to try to find an answer. I didn’t spend almost 50 years in
   building software to give up. This is a hobby project for my daughter and I will
   try to convince here to drop Jetpack.
 * If you do see any solution certainly post it please.
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12777891)
 * Will do.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘CPT with Jetpack “like” function’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/cpt-with-jetpack-like-function/#post-12777891)
 * Status: resolved