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.

add_meta_box does not go ‘side’

This might be caused because you have tried to move your custom meta box to some place and WordPress respects the user’s ordering/positioning of these boxes. You can do as gmazzap has told because this will create a new user with blank preferences. Or you can login to your database, find DBPREFIX_usermeta (DBPREFIX is your … Read more

how to sanitize checkbox input?

Be sure to set the value in your markup. You should have. <input type=”checkbox” name=”changeposition” value=”yes” /> Then, I’d suggest using sanitize_key() to sanitize. Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed. Think of the word yes, as a key. That’s what you’re expecting is a lowercase alphanumeric value. … Read more

Getting the ID of a meta box

Here’s what I would do in order to get the ID of the metabox, In the Dashboard where the meta boxed are located, open up the Screen Options tab on the upper right corner Open up your browser’s developer tool (ex: Chrome) Use the element selector () and select the checkbox label that is listed … Read more

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