WordPress.org

Ready to get started?Download WordPress

Forums

Post Types Order
[resolved] No sorting for custom post type (5 posts)

  1. lzevon
    Member
    Posted 1 year ago #

    The theme I'm using has a built in slider and the option to sort slider options is not present. This is the code in the custom_post.php file. Is something missing here that would cause the post-types-order plugin from working? I'm not sure the developer adhered to whatever the codex defines as a valid custom post type?

    <?php
    // ==================================================================
    // Post type - Slider
    // ==================================================================
    function post_type_slider() {
    register_post_type('sliders',
      array(
      'label'               => 'Slider',
      'singular'            => 'Slider',
      'description'         => 'Slider content',
      'public'              => true,
      'capability_type'     => 'page',
      'exclude_from_search' => true,
      'hierarchical'        => true,
      'query_var'           => true,
      'menu_position'       => 5,
      'supports'            => array(
        'title',
        'thumbnail',
        'page-attributes',
      ),
      'rewrite'             => true,
      ));
      flush_rewrite_rules();
    }
    
    add_action('init', 'post_type_slider');

    Thanks

    http://wordpress.org/plugins/post-types-order/

  2. tdgu
    Member
    Posted 1 year ago #

    Unfortunate the plugin can sort only non-hierarchical post types, so you should change the 'hierarchical' => true to false. Or update to Advanced Post Types Order which can handle all types.

  3. lzevon
    Member
    Posted 1 year ago #

    Got it, thanks, I set the value to false and boom, it works! Would having hierarchical set to 'true' prevent me from even manually editing dates and sorting the order? Because when I tried to adjust time/date stamp it had no effect?

    Thank you @tdgu!

  4. tdgu
    Member
    Posted 1 year ago #

    The hierarchical property should have any effect on the date change.

  5. lzevon
    Member
    Posted 1 year ago #

    OK, thanks tdgu, I'm all set now. I appreciate the help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic