• Resolved Jim Reekes

    (@reekes)


    So far I’ve created a custom post, added custom taxonomy, and things are coming along nicely. But there’s one problem.

    My custom posts are being appended to my blog, like this mydomain.com/blog/news/custom-posts

    I want something like this mydomain.com/news/custom-posts

    How do I remove ‘blog’ being being inserted into my custom post’s permalink?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jim Reekes

    (@reekes)

    BTW – in my permalinks settings, the Custom Structure is set to /blog/%postname%/

    I very much do want my blog at mydomain.com/blog/

    I want my custom posts of news to be at mydomain.com/news/

    The problem is my news custom posts are showing up at mydomain.com/blog/news/

    Teodor Cosofret

    (@teodor-cosofret)

    Hi,

    Thank you for reaching out to us.

    First you will need to go to Settings -> Permalinks -> And select Post name.

    Then go to WCK -> Custom Post Type Creator and add a new CPT -> Post type: post, Singular label: Post, Plural Label: Posts, Hierarchical: false, Has Archive: true, Supports all except page-attributes. Click on Show Advanced Options -> Choose the Taxonomies, set Rewrite: true, Rewrite Slug: blog -> Add Entry.

    Inside your functions.php file add:

    add_action('admin_menu','remove_default_post_type');
    function remove_default_post_type() {
    remove_menu_page('edit.php');
    }

    Now Posts should have the following url: mydomain.com/blog/post and Custom Post Types should have mydomain.com/news/.

    Test it out and let me know if it works for you.

    Best regards,

    Thread Starter Jim Reekes

    (@reekes)

    Perfect!

    Exactly what I needed (and I understood what you were doing, which is a big help in the future)

    Thanks a million.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘permalink for custom posts’ is closed to new replies.