I guess the problem is
$qry = new WP_Query(array('category_name'=>$GLOBALS['city'],'order'=>$orderby));
Let’s just say $orderby is orderby=title&order=ASC
Then the order argument of WP_Query will be like this:
'order'=>'orderby=title&order=ASC'
However, order argument only accepts: ASC and DESC.
You should do somethings like this:
WP_Query('category_name=".$GLOBALS["city'].'&'.$orderby);
Related Posts:
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- How to WP_Query posts order by parent title?
- Ajax filter with loadmore button
- Querying posts based off a jquery datepicker
- Query category-specific, paginated posts and allow viewer to change sort order
- Pass media upload value to input field
- Real time Duplicate title check
- Load custom field value into div with AJAX
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- How can I set custom order use this function
- Duplicates with WP_Query loop
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- Stumped – Ajax Response Returns 0
- Use wp_get_recent_posts with search term
- Parsing php string in jquery [closed]
- doing an ajax request always outputs 0
- Limiting woocommerce line_total decimal length
- Using shipped version of jquery
- have_posts() execution failure
- Can’t search posts using WP_QUERY inside AJAX Function
- Woocommerce add to cart quantity buttons with AJAX
- How can I use wp_query to show all product data using just the products ID?
- class click counter save number
- wordpress count link clicks by ip address
- Advanced Meta Query for Large Calendar Website (12k+ posts) (175k+ wp_postmeta rows)
- Is there a way to programmatically create multiple pages utilizing the same template but different content from a json file?
- Ajax load more posts with multiple tax query
- WordPress Sending data to Ajax with select option
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- Ajax request not sending to server and returning – wp-admin/admin-ajax.php 400
- Add more button if more 8 items
- How to store post ID’s in cookie or session to display the same posts later
- populate form fields in a loop with ajax
- Recent Posts Not Showing Only On A Specific Category Page [closed]
- Gravity form built in Captcha
- comments sorting incorrectly across multiple pages
- auto-populating custom nav with all items from custom post type
- Plugins not working on AJAX requests
- How to disable controls in theme customizer?
- JQuery calling a Custom PHP function (Works in Dev but not in WordPress)
- Jquery function working in Dev Console but not otherwise [duplicate]
- WordPress theme options error
- Get posts from multiple post type
- WP_Query fails despite having 1 post
- Flexslider won’t work on WordPress
- the_posts_pagination() not working in wpquery
- WP_Query: getting posts where custom field exists
- Increment paged on WP_Query
- jQuery Ajax PHP function call returning [object Object]
- Custom route and query
- Getting posts to exclude from array
- Custom post type permalinks do not appear using the link functions
- array_rand not working correctly?
- WP_Query() load selected post
- How to extract information from a wp_query result?
- Execute Jquery when a specific page in my plugin is loading
- Cloning add_settings_field() with jQuery
- Modifying WP URL handing code?
- How to load previous or next attachment with jquery ?
- orderby meta_value_num is not working, giving default order
- How can I modify this code to make the search box include tags and meta
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- How to set value selected using select2 jquery plugin
- Customizer control save then return to default
- WP_Query for woocommerce products with a pattern as a post_title
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
- meta_query search names when they have middle initials
- Query by pagename not Working
- Display featured image of post type category
- Delete post meta by serialized meta value
- Update $wpdb query with AJAX
- AJAX to add to cart multiple products woocommerce
- Getting info about selected posts using one WP_Query
- Remove specific javascript when viewing page in Customizer?
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- WordPress load javascript file if something… (after the page is loaded)
- How to return count of items found in SQL query
- I was wondering if it’s possible to implement card.js on WordPress
- AJAX Filter WHILE Loop not working WordPress
- For each 3 posts, show a different post type
- Form not working as it should in WordPress, but in a normal HTML site it does
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Weird Behaviour: Not all WordPress Posts appearing
- Fatal error: Call to a member function get_results() on a non-object in on line 26
- wordpress is_main_query() breaks
- allow previews outside wordpress folder (Outsourcing WP previews)
- What is the best way to get the first few post from WordPress in different divs using a loop?
- Advanced Taxonomy query, with 3 post types
- Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
- Cannot get custom javascript to execute on page
- Fix incorrect related posts code snippet
- Jquery autosave text area after typing
- Pass a PHP variable (loop-audio.php) to jQuery function (js/script.js)
- Execute multiple PHP Snippets causes error?
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- How can I display all these movies in DESC order by modified?
- generate excerpt from the part of big text dump that contains keyword
- How to sort search result by post_title, then by post_content
- How to get posts by a certain author in inner loop using outer loop variable or post title WordPress