Meta query with compare by more than 2 fields
Nested relations among subset of meta queries are possible on WP 4.1 that is planned to be releaded next coming December 10, 2014. See trac ticket. So wait a few days or use the beta version.
Nested relations among subset of meta queries are possible on WP 4.1 that is planned to be releaded next coming December 10, 2014. See trac ticket. So wait a few days or use the beta version.
$search_term is already an array of an array. When you eventually add that to your meta_query, you get an array of an array of an array, which will not work You are using AND as your relation operator which is the default for a multi-array meta_query. I would suggest that you drop that, and then … Read more
$category = get_category($latest_issue); // it is category object echo $category->title; echo $category->description; in codex: http://codex.wordpress.org/Function_Reference/get_category But i think you should get category not by last created ID, but by slug: http://codex.wordpress.org/Function_Reference/get_category_by_slug So you should change: <?php $issue = get_terms(‘category’, ‘orderby=ID&order=DESC&number=1&child_of=3’); $latest_issue = $issue[0]->term_taxonomy_id; ?> <?php query_posts(array( ‘category__in’ => $latest_issue )); ?> to <?php $issue_category = … Read more
You could do it with something like this in theme functions.php (at end) add_action(‘admin_menu’, ‘news_admin_test’); function news_admin_test() { add_menu_page( ‘News Page Title’, ‘News Option’, ‘manage_options’, ‘newspage’, ‘show_menu_news’, get_home_url() .’/wp-content/themes/my_theme/assets/img/logo.png’ ); } function show_menu_news () { echo ‘News content’; }
Unable to test this at the moment, but try something along these lines. Search all posts for your Post Name (Special title), grabbing the ID’s, then utilize post__not_in to exclude those IDs in get_posts. function getAllPostIdsTest(){ global $wpdb; $excluded_posts = $wpdb->get_results(“SELECT id FROM ” . $wpdb->posts . ” WHERE `post_title` LIKE ‘%”Special title”%’ && `post_type` … Read more
You are not going to this in one query, you will need to do two queries. The first query will hold the posts which will hold the meta key, the second will be the posts without the meta key. (Just a note: never use query_posts unless you intentionally wants to break things) You can try … Read more
As you can see in your custom WP_Query, you pass hardcoded aguments, you are not evaluating the arguments passed in the URL, so they does not affect to the result. In your case, it seems that using a custom query for the archive template is the bad way. When you request the archive template, the … Read more
The answer is, this can”t be done with any efficiency. The best thing to do is pull the data out of the serialized array and save each as their own key/value pair in the wp_usermeta table. My key was extraInfo and the values I needed were serialized in the value. This is the script I’ve … Read more
Per the comment from @ialocin I switched from WP JSON API to WP REST API. There is much less documentation with the rest api but it’s customizable using native wordpress functions. Also, it has a nifty github plugin for allowing use with ACF custom fiends. Anyway, the documentatino for customization the wp rest api is … Read more
Ok, I did it another way. First, get all the terms for the taxonomy. If the term is equal to the value requested, put it into an array Then do the tax_query with this array. Final $argsc = array( ‘order’ => ‘ASC’, ‘hide_empty’ => true, ‘fields’ => ‘all’, ); $termsc = get_terms(“cities”, $argsc); $cities_array = … Read more