Title: Plugin Jetpack- Trying to alter functions.php
Last modified: August 30, 2016

---

# Plugin Jetpack- Trying to alter functions.php

 *  [senn39](https://wordpress.org/support/users/senn39/)
 * (@senn39)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-jetpack-trying-to-alter-functionsphp/)
 * Can anyone tell me what I am doing wrong. I was given these 2 codes to put into
   my functions.php file by “Jetpack”. I have tried several different plugins and
   nothing works. Is there something wrong with the code itself?
 * 1.You can add Publicize support to an existing post type thanks to the add_post_type_support()
   function. To do so, add the following code to a functionality plugin:
 *     ```
       add_action('init', 'my_custom_init');
       function my_custom_init() {
           add_post_type_support( 'product', 'publicize' );
       }
       ```
   
 * You’ll need to replace “product” by your Custom Post Type name.
 * 2.You can add Publicize support when registering the post type, like so:
 *     ```
       // Register Custom Post Type
       function custom_post_type() {
   
           $labels = array(
               'name'                => _x( 'Products', 'Post Type General Name', 'text_domain' ),
           );
           $args = array(
               'label'               => __( 'product', 'text_domain' ),
               'supports'            => array( 'title', 'editor', 'publicize', 'wpcom-markdown' ),
           );
           register_post_type( 'product', $args );
   
       }
       // Hook into the 'init' action
       add_action( 'init', 'custom_post_type', 0 );
       ```
   
 * [Moderator note: code fixed. Please wrap code in the backtick character or [use the code button](https://codex.wordpress.org/Forum_Welcome#Posting_Code).]

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

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-jetpack-trying-to-alter-functionsphp/#post-6619675)
 * Hi senn39!
 * Before we can resolve this are you able to provide a little more information 
   for us?
 * Where did you paste that code to? What is the custom post type you are trying
   to add support to? Is the module ( publicize ) active? Have you tried deactivating
   all other plugins to see if that resolves the issue? Have you tried using a bundled
   theme like Twenty Fourteen/Fifteen to rule out any theme conflicts?
 *  Thread Starter [senn39](https://wordpress.org/support/users/senn39/)
 * (@senn39)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-jetpack-trying-to-alter-functionsphp/#post-6619682)
 * Hi Jose,
    First I tried the plugin “My Custom Functions” then I tried “Css&JavaScript
   Toolbox”, and “Enlighter.” Then I tried putting it on the Functions.php file 
   itself.
 * I run a “Clipper” theme website so my custom post is “coupons.”
 * Yes “Publicize” is active. The problem with it is that it only recognizes “Posts.”
   That is a known problem that they provide a fix for which is the 2 codes that
   I have but they aren’t working.
 * I even tried for a week to teach myself php so that I could write a code myself
   but that was futile. Any help would be greatly appreciated.
 * Thanks,
    Michele Senn
 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-jetpack-trying-to-alter-functionsphp/#post-6619728)
 * Hi Michelle!
 * The provided code will work for the `product` post type. Not sure if you changed
   it to `coupons` though.
 * So the code would be:
 *     ```
       add_action('init', 'ms_add_publicize');
       function ms_add_publicize() {
           add_post_type_support( 'coupons', 'publicize' );
       }
       ```
   
 * It has to match the name of the post type otherwise it will not work. I found
   this out when I tried adding support for Easy Digital Downloads and kept racking
   my brain why it wasn’t working. Turns out I misspelled `download`. Yeah. Who 
   had the red face? Me!
 * If you want that to remain when you switch themes, then you can keep using the“
   My Custom Functions” plugin that way you won’t lose that functionality if/when
   you switch themes. 🙂
 * Hope that helps you out a little more. 🙂
 * Any further questions let us know!

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

The topic ‘Plugin Jetpack- Trying to alter functions.php’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [publicize](https://wordpress.org/support/topic-tag/publicize/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/plugin-jetpack-trying-to-alter-functionsphp/#post-6619728)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
