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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)