grappler / polylang-slug

A unique post slug within the language in Polylang. This allows for a page to have same/identical slug in multiple languages.
268 stars 84 forks source link

custom post 404 due to rewrite #25

Closed lewisbilsland closed 8 years ago

lewisbilsland commented 8 years ago

I am using custom post types, when activating the slug plugin the custom posts now return a 404 error, flushing permalinks does not help

grappler commented 8 years ago

What plugin or code are you using for the CPT? Have you tried disabling the plugins one by one and reverting to the default theme?

Are you using a custom query?

The plugin is working for me with a custom post type. https://wpzoo.ch/en/themes/penguin/

lewisbilsland commented 8 years ago

I tried disabling plugins one by one, also switching theme, each time the custom post type was released only when the slug plugin was deactivated, this is the code being used for the cpt

add_action('init', 'news_register');

function news_register() {

    $labels = array(
        'name' => _x('News and resources', 'post type general name'),
        'singular_name' => _x('News and resources', 'post type singular name'),
        'add_new' => _x('Add New', 'News and resources item'),
        'add_new_item' => __('Add New News and resources Item'),
        'edit_item' => __('Edit News and resources Item'),
        'new_item' => __('New News and resources Item'),
        'view_item' => __('View News and resources Item'),
        'search_items' => __('Search News and resources'),
        'not_found' =>  __('Nothing found'),
        'not_found_in_trash' => __('Nothing found in Trash'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'menu_icon' => true,
        'rewrite' => array( 'slug' => 'news-resources'),
        'has_archive' => true,
        'capability_type' => 'post',
        'hierarchical' => true,
        'menu_position' => null,
        'supports' => array('title','editor','thumbnail','page-attributes','excerpt')
      ); 

    register_post_type( 'news' , $args );
}
grappler commented 8 years ago

I just tested the CPT on my test website and it worked without any issues. Is there any way for me access a duplicate of the website where I could debug what is causing the issue?

grappler commented 8 years ago

Closing as this does not seem to be an issue any more.