Inject Query Posts WordPress Plugin | Codefreex Skip to content
Inject Query Posts icon

WordPress plugin

Inject Query Posts

Facilitates injecting an array of posts into a WP query object as if queried. Particularly useful to allow use of standard template tags.

By Scott Reilly10+ active installs
Active installs
10+
Version
3.0.5
Last updated
Apr 23, 2025
Tested up to
WordPress 6.8.13
Requires
WP 3.6

Health check

Is Inject Query Posts safe to rely on?

Our reading of the public WordPress.org data: maintenance, compatibility, ratings and support.

No update in over a year

Last updated on April 23, 2025. It may not be compatible with current WordPress or PHP, and unfixed issues are a security risk.

Not yet tested with the latest WordPress

Tested up to WordPress 6.8.13. It often still works, but check on staging first.

Rank tracker

Where Inject Query Posts ranks in WordPress.org search

Its position in WordPress.org plugin search for its tags and name, refreshed weekly so you can see how its visibility changes.

WordPress.org search positions for Inject Query Posts
KeywordPositionChangeTrendCurrent #1
loop
posts
query
template tags
wp query
inject query posts

Checked against the top 100 WordPress.org search results.

Overview

What Inject Query Posts does

This plugin provides a function for use by developers who have their own code for fetching posts according to a given criteria and now want to make use of loop-aware template tags to display those posts.

WordPress’s template tags are intended to be used within ‘the loop’. The loop is managed by a WP_Query object which sets up various global variables and its own object variables for use by the various template tags. The primary purpose of a WP_Query object is to actually query the database for the posts that match the currently specified criteria. However, if you don’t need to query for posts since you already have them by some other means, you can still take advantage of the template tags by injecting those posts into the WP_Query via this plugin.

Depending on the template tags you are looking to use, or the logic you are hoping to employ within a loop, you may need to manually configure some of the query object’s variables.

<?php // Say we're in the sidebar

// We've gotten some post objects on our own.

$posts = c2c_get_random_posts( 5, '' );

c2c_inject_query_posts( $posts );

Description from the author's listing. Read the full listing on WordPress.org

FAQ

Inject Query Posts: questions and answers

What is Inject Query Posts?

Inject Query Posts is a WordPress plugin by Scott Reilly. Facilitates injecting an array of posts into a WP query object as if queried. Particularly useful to allow use of standard template tags.

Is Inject Query Posts free?

Inject Query Posts is listed in the WordPress.org plugin directory, so the version there is free to download and use. Some authors also sell paid add-ons or a premium edition with more features and support.

How many websites use Inject Query Posts?

WordPress.org reports 10+ active installations of Inject Query Posts. That figure counts sites running the WordPress.org version and is rounded down by WordPress.org.

Is Inject Query Posts still maintained?

Inject Query Posts was last updated on April 23, 2025. The current version is 3.0.5. Check the changelog on WordPress.org and test updates on a staging site before applying them to a live site.

What does Inject Query Posts require?

Inject Query Posts requires WordPress 3.6 or newer. It has been tested up to WordPress 6.8.13.

Can Codefreex set up or customize Inject Query Posts?

Yes. Codefreex installs, configures and customizes WordPress plugins including Inject Query Posts, fixes conflicts and performance problems, and builds custom features when a plugin does not do exactly what you need. Send your site URL for a free review.

Free expert review

Need Inject Query Posts set up, customized or fixed?

Tell us about your site and what you need this plugin to do. A senior WordPress developer replies within one business day with a plan and a quote.

Built this plugin yourself? We help WordPress product teams with development, support load and growth. Talk to us