Support » Plugin: Jetpack by WordPress.com » Sharedaddy and Publicize not working with custom post

  • Resolved Saharnava

    (@saharnava)


    Hello Jetpack Team

    I’m working on some issues about Jetpack on my personnal website : http://www.saharnava.fr.
    I created in a personal plugin two custom posts with custom fields managed with ACF plugin. Before 2.1.1 update, Publicize worked well, even with my custom posts. Until 2.1.1, no email is sent when I publicize a “recette” or an “ingrédient”. And I don’t have the Publicize section in the Publish box on my custom posts.
    About Sharedaddy, when somebody clicks on a sharing button on one of my custom posts, there is a popu but not containing the sharing window of Facebook or Twitter but it reloads my page…

    Is there anyone who has the same issues and might have some ideas to fix it?

    Thank you for your help

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

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

    (@jeherve)

    Jetpack Mechanic

    Did you use Custom Post Types to create these custom posts? Could you give me a link to one of your “recettes” or “ingrédients” so I can investigate further?

    Thanks!

    Hello Jeremy

    No I created them with PHP. Here is the code

    function create_grimoire() {
    	register_post_type( 'recette',
    		array(
    			'labels' => array(
    				'name' => __( 'Recettes' ),
    				'singular_name' => __( 'Recette' ),
    				'add_new' => __( 'Ajouter' ),
    				'all_items' => __( 'Toutes les recettes' ),
    				'add_new_item' => __( 'Ajouter une nouvelle recette' ),
    				'edit_item' => __( 'Modifier cette recette' ),
    				'new_item' => __( 'Nouvelle recette' ),
    				'view_item' => __( 'Afficher cette recette' ),
    				'search_items' => __( 'Rechercher des recettes' ),
    				'not_found' => __( 'Aucune recette disponible' ),
    				'not_found_in_trash' => __( 'Aucune recette disponible dans la poubelle' ),
    				'parent_item_colon' => '',
    				'menu_name' => __( 'Recettes' )
    			),
    		'description' => __( 'Toutes les recettes de le grimoire' ),
    		'public' => true,
    		'query_var' => true,
    		'has_archive' => true,
    		'menu_position' => 5,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'taxonomies' => array( 'post_tag', 'category' ),
    		'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'revisions', 'thumbnail', 'comments', 'trackbacks' )
    		)
    	);
    	register_post_type( 'ingredient',
    		array(
    			'labels' => array(
    				'name' => __( 'Ingrédients' ),
    				'singular_name' => __( 'Ingrédient' ),
    				'add_new' => __( 'Ajouter' ),
    				'all_items' => __( 'Tous les ingrédients' ),
    				'add_new_item' => __( 'Ajouter un nouvel ingrédient' ),
    				'edit_item' => __( 'Modifier cet ingrédient' ),
    				'new_item' => __( 'Nouvel ingrédient' ),
    				'view_item' => __( 'Afficher cet ingrédient' ),
    				'search_items' => __( 'Rechercher des ingrédients' ),
    				'not_found' => __( 'Aucun ingrédient disponible' ),
    				'not_found_in_trash' => __( 'Aucun ingrédient disponible dans la poubelle' ),
    				'parent_item_colon' => '',
    				'menu_name' => __( 'Ingrédients' )
    			),
    		'description' => __( 'Tous les ingrédients du grimoire' ),
    		'public' => true,
    		'query_var' => true,
    		'has_archive' => true,
    		'menu_position' => 6,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'taxonomies' => array( 'post_tag', 'category' ),
    		'supports' => array('title', 'editor', 'excerpt', 'custom-fields', 'revisions', 'thumbnail', 'comments', 'trackbacks' )
    		)
    	);
    }
    add_action( 'init', 'create_grimoire' );

    A link to a “recette” : http://www.saharnava.fr/recette/gel-douche-a-la-noix-de-coco/
    A link to a “ingrédient”: http://www.saharnava.fr/ingredient/amande-douce/

    Thank you for your help

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    Thanks! I forwarded the issue to one of our developers, and I will keep you posted about the results!

    Thank you very much Jeremy !!!!!
    I have no idea of what I did wrong… 🙁 I hope they’re gonna find.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    It seems that Publicize to Custom Post Types is not yet supported by Jetpack. We plan on implementing such feature, but it will require significant changes to the Publicize code, so I don’t have an exact ETA for that yet.

    In the meantime, I am afraid I can only suggest that you use another autoposting plugin for your recettes and ingredients.

    Thank you Jeremy.
    And what about Sharedaddy?

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    Sharedaddy should work, and does seem to work on both of the pages you linked to earlier:
    http://www.saharnava.fr/recette/gel-douche-a-la-noix-de-coco/
    http://www.saharnava.fr/ingredient/amande-douce/

    Unfortunately it’s not working : Facebook, Twitter, G+ et Pinterest buttons open a popup which reload the page inside and does not propose to share this. And the mail button does not send anything.
    I tested it on Chrome, Safari and Firefox on Mac and on IE 8 and Firefox on PC. Same problem…

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic

    Could you try to disable all other active plugins on your site, one by one, to see if one of them conflicts with the sharing buttons?

    I just tested the code you provided above on a test blog of mine, and the sharing buttons worked properly.

    Thanks!

    Hello Jeremy
    I disabled everything, except my plugin containing the code for my custom posts and I still have the problem… So it seems to come from my code…

    I see where it’s coming from :

    // Template selection
    if ( ! function_exists( 'grimoire_template_redirect' ) ) {
    	function grimoire_template_redirect()
    	{
    		global $wp_query, $post, $posts;
    		if( 'recette' == get_post_type() && $wp_query->is_single ) {
    			include( GRIMOIRE_PATH . '/templates/single-recette.php' );
    			exit();
    		}
    		else if( 'ingredient' == get_post_type() && $wp_query->is_single ) {
    			include( GRIMOIRE_PATH . '/templates/single-ingredient.php' );
    			exit();
    		}
    		elseif( 'recette' == get_post_type() && $wp_query->is_category ){
    			include( GRIMOIRE_PATH . '/templates/category-recette.php' );
    			exit();
    		}
    		elseif( 'ingredient' == get_post_type() && $wp_query->is_category ){
    			include( GRIMOIRE_PATH . '/templates/category-ingredient.php' );
    			exit();
    		}
    	}
    }
    add_action("template_redirect", 'grimoire_template_redirect');

    I have no idea how to fix it…

    I fixed it by just removing the template_redirect. Now it is working. Thank you for your help.
    Hope your gonna find soon how to make Publicize working with custom post.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Sharedaddy and Publicize not working with custom post’ is closed to new replies.