Given that the page works if you leave the original query alone, your solution is pretty simple. Leave the original query alone. You don’t need to overwrite that query in order to created secondary loops. Instead of this:
query_single('dealers', 'publish', '1', $taxtype, $value);
if (have_posts()) :
while (have_posts()) :
the_post();
You want:
$myq = new WP_Query($args);
if ($myq->have_posts()) :
while ($myq->have_posts()) :
$myq->the_post();
You can do that as many times as you want on the page and not clobber the main query. The catch is that I don’t know what single_query is and so I don’t know exactly what $args should look like. Given the way the code works I suspect that single_query runs query_posts, which is strongly discouraged. It could just as easily return a new WP_Query object for you to use, if you tweaked it.
Reference
Related Posts:
- Changing wordpress/woocommerce notices default message to other languages (text)
- PHP Deprecated: Non-static method should not be called statically
- Plugin.php: PHP Notice: Undefined offset: 0 in
- Why Better WP security plugin returns 418 I’m a Teapot “error”?
- Unable to activate wordpress importer after installing it
- WordPress shows error related to allow_url_fopen
- UTF-32be error WordPress
- Why does this code snippet create a critical error on my site? [closed]
- Replace old theme that understand old css (vcex_icon_box css_animation)
- Open_basedir errors – But setting basedir to none redults in 502 Bad Gateway
- WordPress fatal error from php protocol codes
- Undefined offset: 0 in WordPress after latest version upgrade [closed]
- PHP Error message Upload images to remote server
- I can’t view the orders on the woocomerce dashboard with the brainblocks plugin
- Modifying server’s response to API endpoint
- Plugin debugging with errors in activation routine
- A more elegant way to handle notices/warnings
- How is wp_admin_notice supposed to work?
- How to eliminate weird 404 errors in wp-admin?
- Hide php Notices in Dashboard
- Simple form that saves to database
- How to call plugin path in JS?
- Get Current user email as a return string value
- How can I make content disappear when a user logs in?
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- Determining where fopen() is writing files when used from WordPress AJAX call [closed]
- New Plugin: Post update pushes a copy as a revision
- Overide a function that is inside a plugin
- How to install and activate a plugin via an external PHP script
- How to remove xmlns on language_attributes()?
- Add keywords meta to index.php page
- Executing my function once on a specific time
- Redirecting a buddyboss profile tab to a different tab if not subscribed to a specific membership
- WooCommerce: Building a page with user input which is used to query order status and external API and return a result
- Why “Call to a member function on a non-object” in plugin only?
- What are the specifics of WordPress development I need to know? [closed]
- How to echo text in browser instead of download junk file?
- How to create a custom post type that contains another custom post type?
- WP Query. Is there a maximum size?
- Redirect to another page using contact form 7? [closed]
- Is wp-app.php or wp-apps.php needed for WordPress?
- Warning: Use of undefined constant list_all – assumed ‘list_all’ (this will throw an Error in a future version of PHP)
- How to distinguish if a plugin is not installed or just not active
- JavaScript in a PHP plugin
- Checking the count within a foreach loop
- Can’t activate Plugin: unexpected T_STRING, expecting T_FUNCTION [closed]
- Is there a function to list all uploaded images? How can I add one?
- Need to replace Currency Shortforms
- How to delete all categories programatically?
- How to use custom Javascript code inside a plugin?
- How to use printf to output two links?
- speed up pagination for huge database
- Plugin showing error
- Problem after updating plugins
- Building a plugin into a theme
- 2 wordpress site same database
- How to redirect to a page after the form is submitted
- How to display results from a data table with an encrypted user id?
- add_action for publish_post doesn’t work
- All new plugins generating 311 chars of unexpected output?
- How to proper escape echo inside a javascript tag
- Checkbox show / hide output result
- Custom Logo Link WordPress
- How to convert Currency from USD to other IP Based currency in Php function
- How do I reinit WordPress plugins dynamically using jS?
- Attempting to list all product categories and the price range of all products within them
- WP Import All Multiple Dynamic Link Imports
- admin_notices show after load completed
- WordPress + python integration
- Newbie problem with adding include wp_footer
- Plugin which unlock free gift when you reach some amount in cart
- is there a way to display product gallery images via cdn
- How can I create a secure file download in WordPress?
- How can I see $post object in frontend from functions.php?
- Move plugin pages from dashboard to front-end
- Object of class WP_Error could not be converted to string in /formatting.php
- Get post content inside plugin class method
- Ajax call to php function doesn’t work PHP code
- Python in WordPress – A “Hello World” implementation
- Compare Ajax Data Results
- WordPress PHP error getting posts from another wordpress blog
- Restrict role to use a plugin
- Creating new option (add_option) from AJAX – Settings API
- Use WP_Query for custom post type but result get empty
- Same Title on two different post type with single custom taxonomy
- Every time I use wp_get_current_user() my plugin breaks
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- Need help integrating plugin into theme
- AJAX doesn’t pass variables to the php function in the plugin
- Move related products after product summary? [closed]
- wordpress select multiple options and illegal string offset ‘timeslot’ [closed]
- post_exists() returns a 0 but the 0 doesn’t register [closed]
- Foreach retun in shortcode
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Posts in Admin only display 1 Post instead of all Post in admin area
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- WordPress Throwing Deprecated Errors on its own Files
- Oxygen plugin wordpress stuck in loading sequence forever when trying to edit a page [closed]
- plugin doesn’t retrieve data from database