Inject Query Posts
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.
Envisager une alternative
Inject Query Posts shows warning signs in 2026 — compare the alternatives below before installing. It runs on 10+ sites and was last updated 2 years ago, and scores 32/100 on our health check.
- Petite base d'utilisateurs (plus de 10 installations actives)
- Très peu de critiques jusqu'à présent
- Pas de mise à jour depuis plus d'un an
- Uniquement testé jusqu'à WordPress 6,8 (le dernier est de 7,1)
Comment s'accumule-t-il ?
Côte à côte sur les installations, les mises à jour, les évaluations et le supportTéléchargements quotidiens
Les pics de téléchargement suivent généralement une nouvelle version - chaque site qui met à jour automatiquement compte comme un téléchargement.
Classements
Where Inject Query Posts stands todayWordPress.org Classements de recherche
Position en direct dans la recherche de plugins, Top 100| Mot-clé | Position |
|---|---|
| loop | >100 |
| des postes | >100 |
| query | >100 |
| template tags | >100 |
| wp_query | #95 |
Adoption de version
Part de sites actifs par version.
About Inject Query Posts
From the official readme · v3.0.5Description
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.
Exemple :
<?php // Say we're in the sidebar
// We've gotten some post objects on our own.
$posts = c2c_get_random_posts( 5, '' );
// Inject the posts
c2c_inject_query_posts( $posts );
// Now let's display them via template tags:
if ( have_posts() ) :
while ( have_posts() ) : the_post(); ?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
<?php endif; ?>
Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage
Developer Documentation
Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the template tag and hooks provided by the plugin.
As an overview, this is the template tag provided by the plugin:
c2c_inject_query_posts(): Template tag to inject an array of posts into a query object as if that query object had obtained those posts via a query.
These are the hooks provided by the plugin:
inject_query_posts_preserve_query_obj: Overrides the value of the$preserve_query_objargument passed to the function. This is not typical usage for most users.c2c_inject_query_posts: Allows use of an alternative approach to safely invokec2c_inject_query_posts()in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site.
Installation
- Install via the built-in WordPress plugin installer. Or install the plugin code inside the plugins directory for your site (typically
/wp-content/plugins/). - Activate the plugin through the ‘Plugins’ admin menu in WordPress
- Use the
c2c_inject_query_posts()function to inject an array of posts into a WP query object. Specify the posts array as the first argument. Configure the query object by passing an array as the second argument. If specifying a WP query object, pass it as the third object; if not specified then the global wp_query object will be assumed.
Journal de modifications
Trivial update: noted compatibility through WP 6.8+ and PHP 8.3+, and updated copyright date (2025)
3.0.5 (2025-04-22)
- Change: Note compatibility through WP 6.8+
- Change: Note compatibility through PHP 8.3+
- Change: Update copyright date (2025)
- Unit tests:
- Change: Explicitly define return type for overridden method
3.0.4 (2024-08-02)
- Change: Note compatibility through WP 6.6+
- Change: Update copyright date (2024)
- New: Add
.gitignorefile - Change: Reduce number of ‘Tags’ from
readme.txt - Change: Remove development and testing-related files from release packaging
- Unit tests:
- Hardening: Prevent direct web access to
bootstrap.php - Allow tests to run against current versions of WordPress
- New: Add
composer.jsonfor PHPUnit Polyfill dependency - Change: In bootstrap, store path to plugin directory in a constant
- Hardening: Prevent direct web access to
3.0.3 (2023-05-18)
- Change: Add link to DEVELOPER-DOCS.md to README.md
- Change: Tweak installation instruction
- Change: Tweak some documentation text spacing and fix a typo
- Change: Note compatibility through WP 6.3+
- Change: Update copyright date (2023)
- New: Add a potential TODO feature
Full changelog is available in CHANGELOG.md.
Pour les développeurs
Est-ce votre plugin ? Montrez les chiffres.
Ajoutez un badge en direct à votre site, docs ou github readme. Il se met à jour par lui-même - aucun compte n'est nécessaire.
Best Inject Query Posts alternatives
All loop plugins →FAQ
Inject Query Posts: quick answers
Réponses directes, extraites des données en direct WordPress.org.
Source : WordPress.org
Is Inject Query Posts free?
Yes. Inject Query Posts is free to download and use from the official WordPress.org plugin directory.
Is Inject Query Posts safe to use in 2026?
Inject Query Posts shows warning signs in 2026 — compare the alternatives below before installing. It runs on 10+ sites and was last updated 2 years ago, and scores 32/100 on our health check.
How many websites use Inject Query Posts?
Inject Query Posts is active on 10+ WordPress websites and has been downloaded 6,334 times since it launched in September 2010. It was downloaded 117 times in the last 30 days.
Does Inject Query Posts work with WordPress 7.1?
Inject Query Posts is officially tested up to WordPress 6.8.13, while the latest release is 7.1.5. It may still work, but try it on a staging site first.
When was Inject Query Posts last updated?
The latest version, 3.0.5, was released on April 23, 2025 (2 years ago).
Who makes Inject Query Posts?
Inject Query Posts is developed and maintained by Scott Reilly.
What are the best alternatives to Inject Query Posts?
The most popular alternatives to Inject Query Posts are ECS (100K+ installs), Tangible: Loops & Logic (2K+ installs) and Addoncraft Repeater For Ele… (100+ installs).
Propulsé par PageForge
Un modèle et une feuille de calcul. Une vraie page pour chaque recherche.
PageForge transforme chaque ligne d'un CSV en une page WordPress avec son propre titre, URL, SEO et schéma, construit sur la mise en page que vous Déjà conçu. Gratuit sur WordPress.org.
- CSV et XLSX, plus Google Sheets sur les professionnels et les entreprises
- Son propre titre, URL, SEO champs et schéma pour chaque page
- Fonctionne avec l'éditeur de blocs, Elementor, Divi et Avada
- Gratuit sur WordPress.org, pas de carte de crédit
