Why is this sortable filesize column in media library not sorting correctly?
Why is this sortable filesize column in media library not sorting correctly?
Why is this sortable filesize column in media library not sorting correctly?
Thanks a lot to @Sally CJ for the answers. It works with changing format of start_at field and adding key in array like this : function my_sort_custom_column_query( $query ) { $orderby = $query->get( ‘orderby’ ); if ( ‘dateevent’ == $orderby ) { $meta_query = array( ‘relation’ => ‘OR’, ‘_start_at’ => array( ‘key’ => ‘_start_at’, ‘type’ … Read more
Css: .tablenav.top .alignleft.actions select[name=”m”], .tablenav.top .alignleft.actions select#cat, .tablenav.top .alignleft.actions input#post-query-submit, .tablenav.top .view-switch { display: none; } Note: You’ll have to take a look at the input elements ID. I guess this will be named different on custom post types.
What you will need to do is loop through an array of category IDs. For example: $categories = get_categories(); Then loop through the categories, and use the category id in your query_posts: foreach($categories as $category) { $args = array( ‘cat’ = $category->ID ) // return your loop here… } Or something… assuming I understand your … Read more
Your meta values are being stored as an array under a single field. You have to store them as individual fields to use them in queries. See this explanation on WPAlchemy data storage modes.
This was a lot more difficult than I anticipated. It seems having multiple while loops can confuse WordPress if it exhausts all the posts. In particular, if a while loop gets to the end of the posts, the next while loop starts from the beginning, causing duplicates to be shown. To get round this we … Read more
You’re not using the Loop. You should also use get_posts instead.
I can see that you are using the standard Twenty Eleven theme, so all you need to do is go edit the page in question from the admin side, and then if you havent changed the orders of things there, you should have a meta-box with a drop down titled “Template“. Choose the “Sidebar Template” … Read more
You could do this with the modulo operator. $posts = get_posts($args); $html=”<ul>”; $limit = 5; $i = 1; foreach ($posts as $post) { $html .= ‘<li>’ . $post->post_title . ‘</li>’; if($i % $limit == 0) { $html .= ‘</ul><ul>’; } $i++; } $html .= ‘</ul>’; echo $html;
functions attached to manage_pages_custom_column get fired for every custom column, you have to check the name of the column within the function to only output data for that specific column: add_action( ‘manage_pages_custom_column’, ‘AddColumnValue’, 10, 2 ); function AddColumnValue( $column_name, $post_id ) { if( ‘thumbnail’ == $column_name ): echo ‘Header Image data here’; elseif( ‘cssColor’ == … Read more