Comments (5)
Tested with Twenty Nineteen, Twenty Twenty and Twenty Seventeen themes and works. Did the custom posts types and taxonomies the user suggested but again, the order works on archive.php and taxonomy-region.php .
Also, checking the “Show advanced view of Post Types” will show other hidden post types/taxonomies ( see screenshot bellow ) in the lists.
In 2nd screen blocks
post can be seen while in the first screen is not there.
from simple-custom-post-order.
Just so I can write it somewhere, I found this issue through https://wordpress.org/support/topic/order-not-working-on-taxonomy-archive/.
I was experiencing the same issue that the OP there was.
I tried deactivating some plugins, including this one. When I turned them back on again I got an error from this plugin :
[30-Apr-2020 16:13:10 UTC] PHP Notice: Trying to get property 'cnt' of non-object in /var/www/project/public/content/plugins/simple-custom-post-order/simple-custom-post-order.php on line 279
[30-Apr-2020 16:13:10 UTC] WordPress database error Unknown column 'term_order' in 'field list' for query
SELECT count(*) as cnt, max(term_order) as max, min(term_order) as min
FROM vpwp_terms AS terms
INNER JOIN vpwp_term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id )
WHERE term_taxonomy.taxonomy = 'department'
made by do_action('admin_init'), WP_Hook->do_action, WP_Hook->apply_filters, SCPO_Engine->refresh
[30-Apr-2020 16:13:10 UTC] PHP Notice: Undefined offset: 0 in /var/www/project/public/content/plugins/simple-custom-post-order/simple-custom-post-order.php on line 279
I went to the plugin settings, turned everything off. Then turned on the CPT I was using it for. The error has gone away but it still isn't ordering on category pages.
I can force it to using the pre_get_posts
work around :
function custom_pre_get_posts($wp_query) {
if (($wp_query->is_main_query()) && (is_tax([ ... taxonomies ... ]))) {
$wp_query->set('orderby', 'menu_order');
$wp_query->set('order', 'ASC');
}
}
add_action('pre_get_posts', 'custom_pre_get_posts');
Maybe this is enough :)
from simple-custom-post-order.
I'm having the same problem as OP. With theme twenty twenty-one and only the plugin that adds the CPT and custom taxonomy enabled, plus SCPO of course, I can change the sort order on the back end and the new order shows on the CPT archive but not on the tax archive.
The problem is on the live site and on the development version of the site, which is on a different server.
I can only think of two things:
- this is an older site, it's been through some things :) Could there be something in the db?
- Do either the custom taxonomy or the CPT require specific arguments? I'm using this plugin.
I've tried a few different things but I'm stuck, I have no idea.
from simple-custom-post-order.
another user having the same issue:
https://wordpress.org/support/topic/doesnt-work-on-custom-post-type-categories/
from simple-custom-post-order.
the solution by JoshuaCrewe was not working for me. here is what worked for me:
add_filter('posts_orderby', function ($orderby, $query) {
if (is_admin() || !$query->is_main_query() || !is_tax([ ... taxonomies ... ])) {
return $orderby;
}
return 'wp_posts.menu_order ASC';
}, 10, 2);
from simple-custom-post-order.
Related Issues (20)
- doubled page-item in grid
- term_order not updated
- Plugin breaks taxonomies on multisite
- Delay between admin and front HOT 3
- Trying to get property ‘cnt’ of non-object HOT 1
- Deadlock found when trying to get lock
- Object cache invalidation missing on drag’n’drop reorder HOT 2
- incompatibility with APCu cache
- Excluding custom query with order and orderby parameter HOT 1
- After creating new post, need to reset post order HOT 5
- The plugin does not work properly HOT 1
- Not saving after sorting HOT 3
- Category Deletion not working when Plugin active HOT 1
- Get notification on order updates
- WP Query object cache HOT 2
- Not work with latest wordpress need update HOT 1
- does not work on mobile devices
- Sync order between languages – WPML
- move to another page HOT 1
- the menu order is not being updated when you drag and drop posts.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-custom-post-order.