Cannot get custom post

Seems like you have a missing array in tax_query instead of ‘tax_query’ => array( ‘taxonomy’ => ‘st_tour_type’ ), should be ‘tax_query’ => array( array ( ‘taxonomy’ => ‘st_tour_type’, ‘operator’ => ‘EXISTS’ ) ), When using tax query without terms/fields we must include the “operator” property. You can check WP_Query taxonomy for more information on working … Read more

Combine 2 WP_queries into one (OR relation)

meta_query can only be used for meta queries, you can’t use it for non-meta parameters. Even if you could, it would not give a performance benefit. What you want can’t be done, and your second example is searching for posts that have a post meta named post_parent. The canonical answer, is to use 2 query … Read more

Shortcode Not Working in Slider When Added To Post Title

do_shortcode() returns the content you pass it with the shortcodes, if any, filtered out (ie, processed). So the code you’ve posted in your question won’t work the way you want it to: do_shortcode( get_the_title() ); printf( ‘<h2><a href=”%s” title=”%s”>%s</a></h2>’, get_permalink(), the_title_attribute( ‘echo=0′ ), get_the_title() ); Instead you’ll need to do something more like this: $title … Read more

Does WordPress have something like Drupal’s DB API?

Yes, there’s the wpdb class. Some examples can be found for e.g. here. Then there’s the global $wpdb object that contains results and other parts, set based on the current routing. You can also utilize the WP_Query class which is more common. There’s a default global $wp_query object and the $wp_the_query(?) intermediary object, that holds … Read more

Get user first name from custom endpoint

If you look at the documentation, first_name is not in the list of accepted values for the fields parameter, and if you enabled debugging, you’d see adding first_name to that parameter would actually cause a database error — Unknown column ‘wp_users.first_name’ in ‘field list’. And the same goes to the “firstname” and any other non-standard … Read more