How to disable Page Attributes dropdown in wp-admin

Removing support for page attributes will prevent that box from appearing… function remove_page_attribute_support() { remove_post_type_support(‘page’,’page-attributes’); } add_action( ‘init’, ‘remove_page_attribute_support’ ); … but I don’t know if you need attributes support or not. If you don’t that is the fix. If you do, you will need to remove the box as per @KrzysiekDrozdz’s answer, but to … Read more

How to add data- attribute to tag

There are two ways to solve this. The first one is what you are trying, but you have to print out the value you get. Like this: print get_post_meta(); I don’t recommend this for two reasons: You should keep your templates as simple as possible. Otherwise they become cluttered with fragments of business code which … Read more

Increment Page Order As Pages Are Created

The following is a possible solution, but needs some testing to confirm it is viable. It runs only if menu_order == 0 and if it’s not an auto-draft or revision being saved add_action( ‘save_post’, ‘incremental_save_wpse_113767’, 10, 2 ); function incremental_save_wpse_113767( $post_id, $post_object ) { if( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; if( defined( ‘DOING_AJAX’ … Read more

Best way to arrange custom post types by Attributes -> Order metabox value?

This did it: add_filter( ‘pre_get_posts’, ‘my_get_posts’ ); function my_get_posts( $query ) { if ( is_home() && false == $query->query_vars[‘suppress_filters’] ) $query->set( ‘post_type’, array( ‘jwf_portfolio’, ‘attachment’ ) ); $query->set(‘orderby’, ‘menu_order’); $query->set(‘order’, ‘ASC’); return $query; } No need to mess with index.php now.

WordPress admin screen very slow / timing out when editing or adding a new page/custom post

This may not help any, but it can’t hurt to try it… Log into your server admin area, invoke the client interface for your database administration (e.g. phpMyAdmin), delete all the posts where their ‘type’ is marked as a revision, then compact the table. If you have thousands of pages, you might also have millions … Read more