Community Forums › Forums › Archived Forums › General Discussion › How position Theme SEO Settings below custom meta boxes on entry screen?
Tagged: Genesis SEO, Meta box
- This topic has 3 replies, 2 voices, and was last updated 8 years ago by rgentile.
-
AuthorPosts
-
September 12, 2016 at 1:50 pm #193029rgentileMember
Hello,
How do I position the Theme SEO Settings to appear below Location Information on the custom post type entry screen in the screen shot below?
I tried changing the order of the items in the supports array ('supports'=> array( 'title', 'thumbnail','genesis-cpt-archives-settings', 'genesis-seo' ), but that is not working. I've done all kinds of searching but have yet to find the answer so I'm thinking my search terms are off. I've been a front end developer for 20 years and have some WordPress experience but am new to Genesis and frameworks so perhaps I am missing something very basic.
Is it possible to control the order the meta boxes appear on the entry screen for a custom post type? If so, how?
Thanks for reading,
robertg
September 12, 2016 at 3:07 pm #193040Brad DaltonParticipantYou can drag it and it will be saved in the DB for each user meta data.
If you want to reposition the meta box for all users, you will need to use custom code. One method would be to remove it and then add it back using a different priority. See the 6th parameter for add_meta_box
September 13, 2016 at 8:47 am #193086rgentileMemberThank you for your time and reply Brad.
I am using CMB2 to create the metaboxes and the priority there is set to 'high':
add_action( 'cmb2_admin_init', 'cmb2_locations_metaboxes' ); function cmb2_locations_metaboxes() { $prefix = '_bzka_'; $cmb = new_cmb2_box( array( 'id' => 'location_metabox', 'title' => __( 'Location Information', 'cmb2' ), 'object_types' => array( 'bzka_locations' ), // Post type 'context' => 'normal', 'priority' => 'high', 'show_names' => true, // Show field names on the left 'cmb_styles' => false, // false to disable the CMB stylesheet ) ); }
I tried changing the priority of my add_action but that had no effect.
add_action( 'cmb2_admin_init', 'cmb2_locations_metaboxes', 9 );
add_action( 'cmb2_admin_init', 'cmb2_locations_metaboxes', 25 );So I then tried adding the code from http://www.billerickson.net/code/move-genesis-metaboxes/
It moves the Theme SEO Settings metabox down on the entry page for a Page but not for my custom post type.
I am creating my custom post type and custom metaboxes in a plugin added to the mu-plugins directory. However, I also tried deleting that plugin and moving the code to my functions.php but nothing changed.
So I am guessing the issue is related to my custom post type but I am not really sure how to continue troubleshooting.
Do you have any suggestions on where to focus my troubleshooting/learning?
Thanks again for your time,
robertg
September 13, 2016 at 4:05 pm #193119rgentileMemberI recreated the plugin file and the metaboxes are now displaying in the order I need them to appear. I am not sure why this resolved the problem but it did so perhaps I made a noob error or fat fingered something.
Thanks.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.