Query order by a numeric ACF field
Query order by a numeric ACF field
Query order by a numeric ACF field
It appears that you’re attempting to add a function to the init action hook from within the function you’re trying to add. Your code is doing this: function portalp_custom_taxonomies() { // … add_action( ‘init’, ‘portalp_custom_taxonomies’ ); // … } …when it needs to do this: function portalp_custom_taxonomies() { // … } add_action( ‘init’, ‘portalp_custom_taxonomies’ ); … Read more
I’m trying to get posts under a custom taxonomy but I don’t know what I’m doing wrong here
Unexpected results custom wp_query and $the_query->request;
WP_Query sort by ACF date field (newest first) with blank dates first
Use value from meta key array for use in WP_Query
date_query returning only the most recent post instead of the post published before today
Display only posts with thumbnails
The meta_value is a longtext type column and isn’t technically a date, wordpress only cast the value based on the type you pass. and Its not about being a text format, its because of your date format that isn’t supported by mysql. your resulting query will be CAST(‘02.05.2024’ AS DATE) which mysql transform it to … Read more
Yes, there is — use a meta_query with 2 clauses, one which selects posts having the meta, and the second clause with a ‘compare’ => ‘NOT EXISTS’ which selects posts without that meta. So in your $args array, just replace the ‘meta_key’ => ‘pld_like_count’ with this one: ‘meta_query’ => array( // make sure it’s OR … Read more