Multiple meta query from array

$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

Show category meta in loop on homepage

$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

How do I add an item to the WP admin menu?

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’; }

Get all posts with a certain meta key, except for one with specific title

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

Sorting posts by ACF field

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

WP JSON API meta_query not working

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)