Advanced search for meta fields

The meta_query parameter must be an array of array if you want to add relation between different key, even they only one key to grab. So $query->set( ‘meta_query’, $meta_query ); Must be $query->set( ‘meta_query’, array($meta_query) ); You can have a look to WP_Query for more details. Hope it helps and work, I just look for … Read more

Displaying All Posts of a Custom Post Type in WordPress Multisite Backend

I was looking for a similar plugin to display all pictures from all sites. Couldn’t find one. Ended up writing my own (Multisite Media Display). Then modified that one for another plugin to display all posts (Multisite Post Reader). You can find that one here: https://wordpress.org/plugins/multisite-post-reader/ . There isn’t an option to display posts of … Read more

Filter custom post types by a field value

I found the solution in this article: https://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/ . I know that it causes a page refresh but going for Ajax based solution is an overkill. This solution code is very elegant and easy to follow and understand. Although taxonomy might be faster they require a lot of work with creating metaboxes and stuff so … Read more