WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Make custom post type primary post type (6 posts)

  1. lxg
    Member
    Posted 3 years ago #

    I love the new feature of the 3.0 series that you can easily define own post types. However, I need to make my post type (and its dedicated taxonomy) the primary one.

    This means:

    • My post type be “video”
    • Its taxonomies be “videocat” and “videotag”
    • I want the permalink structure to be %category%/%post_name% (yes, I know of the performance issues)
    • The /video/ part should not be visible in the URL, instead, there should be the according category.
    • Posts should behave like an custom post type in regard to URL structure.

    In regard to permalinks, the solutions posted in http://wordpress.org/support/topic/custom-post-type-permalink-rewrite did unfortunately not work for me. (Yes, I did flush the rewrite rules.)

  2. lxg
    Member
    Posted 3 years ago #

    I found a solution for the Permalink issue: I have set '_builtin'=>true in the register_post_type() call.

    I know it's marked as internal feature and not recommended for plugin developers, but this exactly the feature that solved my problem.

    All other problems are all solved, too.

  3. electricman5
    Member
    Posted 2 years ago #

    How did you solve the post-type issue? I would like to set a custom post type as the default one as well.

    Please help, thanks!

  4. Triple P
    Member
    Posted 2 years ago #

    @electricman: you can remove menu items with the remove_menu_page() function (since 3.1).

  5. electricman5
    Member
    Posted 2 years ago #

    Where would I put that code?

  6. Triple P
    Member
    Posted 2 years ago #

    To remove the Posts menu item from the admin sidebar, put this in your functions.php:

    add_action( 'admin_init', 'my_remove_menu_pages' );
    function my_remove_menu_pages() {
    	remove_menu_page('edit.php');
    }

    Note that this function simply removes the menu item, the posts admin page will still be accessible for logged in users who know the url, e.g. http://mysite.com/wp-admin/edit.php.

Topic Closed

This topic has been closed to new replies.

About this Topic