How to order different custom post type in category or tag template page?

someone there help me and solved the problem. It works. Cool. Thks guys. Details : First – I remove this code from function.php function namespace_add_custom_types( $query ) { if( ( is_tag() || is_category() ) && empty( $query->query_vars[‘suppress_filters’] ) ) { $query->set( ‘post_type’, array( ‘post’, ‘projets’, ‘disques’, ‘notices’, ‘main_menu’, ‘top_menu’ )); return $query; } } add_filter( … Read more

Order by ‘s’ using WP_Query()

You can use Relevanssi plugin, Relevanssi replaces the default search with a partial-match search that sorts results by relevance. It also indexes comments and shortcode content. https://wordpress.org/plugins/relevanssi/ Search results sorted in the order of relevance, not by date.

Order taxonomy terms by the frequency of use in the last 30 days

First thing’s first — You’ll have to add that table. The way you do that if you were writing this in a plugin is as follows: function customtaxorder_init() { global $wpdb; $init_query = $wpdb->query(“SHOW COLUMNS FROM $wpdb->terms LIKE ‘term_order'”); if ($init_query == 0) { $wpdb->query(“ALTER TABLE $wpdb->terms ADD `term_order` INT( 4 ) NULL DEFAULT ‘0’”); … Read more

WP_Query orderby meta key/value suddely stopped working

Some things to check. Have permissions changed during your migration? Sometimes those things change unexpectedly. Use Chrome inspector to see if any Javascript is failing to load (look for the red x). Have you updated permalinks? Is your new dedicated environment able to support the requirements of everything you’re running? If your code hasn’t changed, … Read more

Order by meta values

You can do this by just looking for release_date_db: function plugin_name_get_posts() { global $wpdb; $the_posts = $wpdb->get_results( “SELECT * FROM $wpdb->posts, $wpdb->postmeta WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id AND meta_key = ‘release_date_db’ AND meta_value >= 20120000 AND meta_value <= 20121231 ORDER BY meta_value ASC;”, ARRAY_A ); }

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