How to sort custom posts including null meta-values in admin columns with meta_query?
How to sort custom posts including null meta-values in admin columns with meta_query?
How to sort custom posts including null meta-values in admin columns with meta_query?
You can use get_term_field() like this: if ($column_name === ‘image’) { $slug = get_term_field( ‘slug’, $term_id ); $columns=”<img src=”” . $slug . ‘.jpg”>’; } Or get_term(): if ($column_name === ‘image’) { $term = get_term( $term_id ); $columns=”<img src=”” . $term->slug . ‘.jpg”>’; }
The new block editor gives lots of possibilities to arrange information inside one post. What you are asking for is the arrangement of multiple posts. That’s not a task for the block editor but for the theme. So, for your question: it depends on the theme whether this is possible. If you are designing your … Read more
How to center entire columns on a page, and have it stay responsive?
WordPress does not could post views, and never has. This has to be added by a plugin or your theme to appear. Even if the counts remain in the database after deactivating the responsible theme or plugin, the column could not appear without the it being active. Make sure you’ve deactivated every plugin, even if … Read more
Try get_field() instead of get_field_object().
I would suggest you create your own menu for each menu you want to show in a column. This way, you only need to set the menus inside your widgets and will not face any problems. It is also ok for a menu to have just one item if needed. 1) You can not seperate … Read more
You can control this with media queries in CSS. @media screen and (max-width: 768px) { div.row { width: 50%; } } /* for iPad */ @media screen and (max-width: 600px) { div.row { width: 100% } } /* for mobile phones */ I hope this helps. UPDATE: You can’t do this with PHP because PHP … Read more
Your columns are in an array. PHP has a few options you can use depending on how you want to sort the array (low to high, high to low, etc.). Here is the documentation for that. https://www.php.net/manual/en/array.sorting.php
I’ve currently “solved” this by backfilling with empty divs: $array_chunks = array_chunk($array_of_posts, 3); foreach($array_chunks as $posts) { echo ‘<div class=”wp-block-columns”>’; foreach($posts as $post) { echo ‘<div class=”wp-block-column”>’; // entry echo ‘</div>’; for ($i = 0; $i < ( 3 – count($posts)); $i++) { echo ‘<div class=”wp-block-column”>’; echo ‘</div>’; } } echo ‘</div>’; } But that … Read more