Articles of menu order

WP_Query Excluding pages with Order is 0

I have a custom WP_Query with the following arguments $args = array( ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘meta_key’ => ’tile-home’, ‘meta_value’ => 1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’ ); That selects all the published pages which have the custom field tile-home set to 1 and orders them by the page attribute Order. How […]

WordPress Admin Menu Order for 'admin.php' pages

I’m using following code to change menu order of WordPress admin panel. function reorder_admin_menu( $__return_true ) { return array( ‘index.php’, // Dashboard ‘separator1’, // –Space– ‘edit.php?post_type=page’, // Pages ‘edit.php’, // Posts ‘edit.php?post_type=portfolio’, // Portfolio ‘admin.php?page=wpcf7’, // Contact Form 7 ‘upload.php’, // Media ‘edit-comments.php’, // Comments ); } add_filter( ‘custom_menu_order’, ‘reorder_admin_menu’ ); add_filter( ‘menu_order’, ‘reorder_admin_menu’ ); […]

Exclude pages by menu order

i have a “Default Page Generator” on theme activation i have created… in that file i set ‘menu_order’ for each page. i want to exclude pages with menu order bigger then 50 from the default wp_list_pages menu Is there a way to check for / retrieve ‘menu_order’ of each page? and if there is can […]

Why isn't my multiple orderby working?

I have a custom category page with the following query: $args = array( ‘cat’ => $portfolioCategories, ‘posts_per_page’ => $itemsPerPage, ‘orderby’ => ‘menu_order date’, ‘order’ => ‘DESC’, ‘paged’ => $paged ); query_posts( $args ); So ‘orderby’ => ‘menu_order’ works just fine. ‘orderby’ => ‘date’ works just fine. But ‘orderby’ => ‘menu_order date’ does not work – […]

Logout hyperlink within a sub-menu

I have the following secondary navigation menu on my website which has been built using the native WordPress Appearance > Menus feature: I am also using the following lines of code in my functions.php file to remove and add the ‘Login / Register‘ and ‘Logout‘ hyperlinks depending on the access privileges of the user: // […]

If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?

So I have 3 custom post types that I want to order by menu_order & have ‘date’ as the fallback parameter as the majority of posts will have the default menu order of ‘0’. It would be nice if pre_get_posts would do this relatively simply (as opposed to something like this – Multiple orderby parameters […]

echo menu_order value in my theme

I thought this would be a simple task, but I cannot find anything on google. I would simply like to echo the meun_order value in my loop. I tried this but it’s not in the post_meta table, its in the post’s table. <?php echo get_post_meta($post->ID, ‘menu_order’, true); ?> Can anyone help please? Thanks Josh

get_pages() as per custom menu order

I’m working on Single Page WordPress Theme where I want to get_pages() as per custom menu order. I have gone through the reference for get_pages() which only allows for default menu : get_pages(‘sort_order=asc&sort_column=menu_order’); Is there any way to get_pages() as per custom menu order ?

Compare string with post id in wpdb and do stuff when match is found

I’m looking for some help tying in with the wpdb to compare and change certain values. I’m very novice with mysql handling so I really appreciate any help on this matter! What I want to do is to go through the wp db looking for a post same id as $page_id. When the post is […]

How do I order pages and categories by ID or name in the same query?

I would like to query most of my pages and categories on the homepage. So far I am able to get the pages and category (posts), but I cannot order the list the way I want to. I want to be able to get a custom order like page, posts from a category, another page, […]