WP Manifestindependent plugin directory
manifest / developer / wordpress-unique-query

Unique WP Query

A plugin for doing unique WP_Query

★ 0stars
1.0.0latest · 2 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/firstandthird/wordpress-unique-query/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

unique-wp-query

unique-wp-query is a Wordpress plugin that can be used to ensure no post is loaded more than once per screen

Features

  • ensures only one of each post is loaded

Installation

just put the root folder in your wp-content/plugins directory and Activate from the plugins console

Usage:

From the demo:

$latest_posts1 = new Unique_WP_Query([
  'post_type' => 'post',
  'posts_per_page' => 3,
  'post_status' => 'publish',
  'post__not_in' => array(18)
]);
$latest_posts2 = new Unique_WP_Query([
  'post_type' => 'post',
  'posts_per_page' => 3,
  'post_status' => 'publish',
]);
while ($latest_posts1->have_posts()) {
  $latest_posts1->the_post();
  echo get_the_title(), '<br>';
}
echo "<br><br>---------------------------------------------------------------------<br><br>";
while ($latest_posts2->have_posts()) {
  $latest_posts2->the_post();
  echo get_the_title(), '<br>';
}

The second list will not include any posts that were in the first

Demo:

This repo includes a docker-compose with a dummy theme that demonstrates the plugin, to use it:
    - __docker-compose up__
    - Open a browser and log in to the Wordpress server
    - Add some dummy posts and then load the main page

A First + Third Project

Releases

1 release.

Tag
Published
1.0.0 latest
Nov 10, 2023 2 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.