5

I have problem with custom post type - permalink is doesn't show:

enter image description here

Post type is published, but I can't it show on website. I tried change permalink structure to ?p=123, but it still doesn't work. I tried change 'rewrite' attribute in code to false, but no difference.

Some ideas where can be problem?

Here is my code for custom post types:

$args_team = array(
    'labels' => sk_post_type_labels( __('Tým', 'sk'), __('Tým', 'sk') ),
    'public' => true,
    'has_archive' => true,
    'exclude_from_search' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'query_var' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'menu_position' => 10,
    'rewrite' => array( 'slug' => 'team' ),
    'supports' => array('title','editor','thumbnail','page-attributes')
);

Thanks for any ideas.

1
  • Please check this plugin to generate custom post types. Use this plugin instead of doing a code. This may help you. Feb 9, 2017 at 10:04

2 Answers 2

5

I set the following to true to display the permalinks in the admin section.

'publicly_queryable' => true,
2
  • 2
    I found you also need to set 'public' => true
    – Felix Eve
    Oct 19, 2018 at 8:52
  • Actually, 'publicly_queryable' => true doesn't have any effect on this. You must set 'public' => true.
    – rassoh
    Mar 9, 2020 at 9:36
0

Try removing exclude from search and set your permalinks to Post name.

you should be able to access with: mysite.com/team/new-team-member

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.