teeli
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [Mobile Detector] Strange behaviour when using Mobile DetectorAfter a quick test, it seems to be working now. Thanks!
Forum: Plugins
In reply to: [Mobile Detector] Strange behaviour when using Mobile DetectorApparently the problem is that the plugin does not explicitly define the cookie’s path, so it creates multiple wp_mobiledts_theme cookies for different paths under the website.
Thanks for the answer. I think I can live with it, but it would be cool if you could improve customization at some point ??
Forum: Hacks
In reply to: Order & filter by multiple taxonomies & termsI guess I managed to solve this. Here’s the updated solution that seems to be working nicely:
$clauses['join'] .= " INNER JOIN (SELECT {$wpdb->terms}.term_id, {$wpdb->terms}.slug, {$wpdb->term_relationships}.object_id FROM {$wpdb->term_taxonomy}, {$wpdb->terms}, {$wpdb->term_relationships} WHERE {$wpdb->term_taxonomy}.taxonomy = 'position' AND {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id AND {$wpdb->term_taxonomy}.term_taxonomy_id = {$wpdb->term_relationships}.term_taxonomy_id GROUP BY {$wpdb->term_relationships}.object_id ) as person_position_relationship ON person_position_relationship.object_id = {$wpdb->posts}.ID"; $clauses['groupby'] = "person_position_relationship.object_id"; $clauses['orderby'] = " FIELD(person_position_relationship.slug, 'janitor', 'developer', 'CTO', 'COO', 'CEO') "; $clauses['orderby'] .= ( 'ASC' == strtoupper( $wp_query->get( 'order' ) ) ) ? 'DESC' : 'ASC'; $clauses['orderby'] .= ", person_position_relationship.slug "; $clauses['orderby'] .= ( 'ASC' == strtoupper( $wp_query->get( 'order' ) ) ) ? 'ASC' : 'DESC';
When using this with posts_clauses filter, you can probably do anything you want with other taxonomies and this only show posts with “position” taxonomy and order by them. Seems to work on my case, but probably need more testing.
Viewing 4 replies - 1 through 4 (of 4 total)