WordPress.org

Forums

Shprink One
Custom Post Types? (3 posts)

  1. micdt
    Member
    Posted 1 year ago #

    Hey Julien,
    Good work, but I wonder how to set Custom Post Types. Some screenshots I have seen make me think it should be possible. But I can't chose any on my local installation.

  2. shprink
    Member
    Theme Author

    Posted 1 year ago #

    First of all sorry if I took 6 days to answer.. It seems that I do not receive any notification when someone add a post here..

    There is no specific behavior for custom post types in Shprinkone sorry. What is your need exactly?

  3. Michel Marrache
    Member
    Posted 1 year ago #

    Try something like this:


    /*
    * Add custom post type for categories
    *
    * @return void
    */
    function codex_custom_menu_post_init() {
    $labels = array(
    'name' => 'Menu',
    'singular_name' => 'Menu',
    'add_new' => 'Add New',
    'add_new_item' => 'Add New Menu',
    'edit_item' => 'Edit Menu',
    'new_item' => 'New Menu',
    'all_items' => 'All Menu Items',
    'view_item' => 'View Menu',
    'search_items' => 'Search Menu',
    'not_found' => 'No menu found',
    'not_found_in_trash' => 'No menu found in Trash',
    'parent_item_colon' => '',
    'menu_name' => 'Menu'
    );
    $args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'show_in_menu' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'menu' ),
    'capability_type' => 'post',
    'has_archive' => true,
    'hierarchical' => false,
    'menu_position' => 5,
    'menu_icon' => "dashicons-editor-justify",
    'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields'/*, 'excerpt'*/),
    'taxonomies' => array( 'post_tag', 'category' )
    );
    register_post_type( 'menu', $args );
    }
    add_action( 'init', 'codex_custom_menu_post_init' );

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic