Custom Post Types
-
I thought I found what I was looking for, when I found this post from a few months ago, but sadly it didn’t help.
https://www.ads-software.com/support/topic/polylang-and-custom-post-types
I’m using a theme that has a custom post type called Slides. I want to be able to have different slides for different languages (English, French), the way French and Englisy posts and pages can be associated with each other.
The above link states
You just have to register your post type as usual for example in a function hooked to the ‘init’ action. If you register it with ‘show_ui’ set to true, then it is automatically created with multilingual support.
The post type is registered with ‘show_ui’ set to true, but there’s no option in the Dashboard to associate slides of different languages (as with regular posts. Also, I’m not sure if the function is hooked to the ‘init’ action. Here it is:
/*-----------------------------------------------------------------------------------*/ /* Create a new post type called slides /*-----------------------------------------------------------------------------------*/ function bnk_register_post_type_slides() { $labels = array( 'name' => __( 'Slides','bhinneka'), 'singular_name' => __( 'Slide','bhinneka' ), 'rewrite' => array('slug' => __( 'Slides','bhinneka' )), 'add_new' => _x('Add New', 'Slide'), 'add_new_item' => __('Add New Slide','bhinneka'), 'edit_item' => __('Edit Slide','bhinneka'), 'new_item' => __('New Slide','bhinneka'), 'view_item' => __('View Slide','bhinneka'), 'search_items' => __('Search Slides','bhinneka'), 'not_found' => __('No slides found','bhinneka'), 'not_found_in_trash' => __('No slides found in Trash','bhinneka'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, 'menu_position' => 5, 'supports' => array('title','thumbnail','custom-fields') ); register_post_type(__( 'slide','bhinneka' ),$args); }
- The topic ‘Custom Post Types’ is closed to new replies.