• Resolved gotfers

    (@gotfers)


    Hi,

    I’ve created a custom post type on a wordpress 4.2.4 website with Polylang 1.7.8. The Polylang box appears on the “add new post” page, but when I save a new custom post, the language is not saved. So my new custom post doesn’t have any language associated. If I edit it, change to the second language, and save, now it works. But it’s not the easiest way to do it ??

    Here the code of my CPT

    add_action( 'init', 'custom_randonnee');
    function custom_randonnee() {
    	$labels = array(...);
    	$args = array(
    		'label'               => 'randos',
    		'labels'              => $labels,
    		'supports'            => array( 'title', 'editor', 'thumbnail', ),
    		'taxonomies'          => array( 'category' ),
    		'public'              => true,
    		'menu_position'       => 5,
    		'show_in_menu'  	  => true,
    		'can_export'          => true,
    		'has_archive'         => true,
    		'capability_type'     => 'post',
    		'map_meta_cap'    	  => true,
    	);
    	register_post_type( 'randos', $args );
    }

    Thanks for your help

    https://www.ads-software.com/plugins/polylang/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter gotfers

    (@gotfers)

    I have to add that all solutions found on the support don’t work…
    Thanks

    Thread Starter gotfers

    (@gotfers)

    I’ve just installed the plugin “The Events Calendar”, and there is the same problem with the CPT “Event” created by this plugin. It doesn’t accept the default language until I save it in the other one, and come back to the default language.

    Plugin Support Chrystl

    (@chrystl)

    Hi
    I tested with your code + Polylang 1.7.8 + Twenty Fifteen and it works.
    Deactivate all your plugins except Polylang and test.

    Thread Starter gotfers

    (@gotfers)

    Dear Chrystl,
    Thank you for your post. The problem comes from plugin “The Events Calendar”. But I don’t know how I can correct it. I will see on their own support forum.
    Thanks again.

    Thread Starter gotfers

    (@gotfers)

    I will post here their answer in case someone else has the same problem

    Thread Starter gotfers

    (@gotfers)

    With some research, I found several posts on the incompatibilty between polylang and the Event Calendar (due to TEC, not polylang). So I will change to another event plugin, as Events Maker

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem with a Custom Post Type’ is closed to new replies.