PHPackages                             whitefiredesign/wp-stick-posts-to-term - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. whitefiredesign/wp-stick-posts-to-term

ActiveLibrary

whitefiredesign/wp-stick-posts-to-term
======================================

This adds simple term-specific sticky posts functionality

1.0.1(9y ago)126[1 issues](https://github.com/whitefiredesign/wp-stick-posts-to-terms/issues)MITPHPPHP ^5.3.3 || ^7.0

Since Sep 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/whitefiredesign/wp-stick-posts-to-terms)[ Packagist](https://packagist.org/packages/whitefiredesign/wp-stick-posts-to-term)[ RSS](/packages/whitefiredesign-wp-stick-posts-to-term/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

\#Stick Posts To Term Contributors: bambattajb Tags: categories, post Requires at least: 4.4.2 Tested up to: 4.4.2 Stable tag: 1.0.3 License: GPLv2 or later License URI:

\##Description This adds simple term-specific sticky posts functionality I created this plugin because I wanted to give the content manager flexibility to be able to set sticky posts to any category or taxonomy term.

It is more of a developer tool. It will not just work 'out of the box'. You need to add code in the theme template files to get it to work.

This is mostly an adaptation of @tommcfarlin plugin `Category Sticky Post` . Tom, I borrowed some of your code as well; I hope you don't mind. Cheers mate :)

Tom's plugin actually does just work 'out of the box' if you're looking for something simple to display sticky's on a per-category basis.

\##Usage When the plugin is installed, a meta box is created in the edit-post screen labeled `Category Sticky`. When the content manager assigns categories or taxonomy terms to the post, this will populate with all the possibilities for where they can stick this post.

To render this on the front end, we use the following static method

```
$sticky_query = StickyPost::query([taxonomy=string], [term=integer], [posts_per_page=integer]);
```

This returns the following

```
stdClass Object
    [query]     => WP_Query Object ## Use as the query for the loop
    [post_ids]  => Array ## The list of post ids that have been queried
```

\##Examples

### Use in Category Template

[](#use-in-category-template)

Because the category template might will probably just have a basic loop, we need to add args on the fly

```
$sticky_query = StickyPost::query('category', get_queried_object()->term_id, 2);
global $wp_query;
$args = array_merge( $wp_query->query_vars, array( 'post__not_in' => $sticky_query->post_ids ) );
query_posts($args);
```

### Use in Taxonomy Template with new WP\_Query

[](#use-in-taxonomy-template-with-new-wp_query)

Say we wanted to return 2 stickies in the current term and wanted to remove those returned posts from another custom `WP_Query`

```
$sticky_query = StickyPost::query('topic', get_queried_object()->term_id, 2);

if ( $sticky_query->query->have_posts() ) {
    while ( $sticky_query->query->have_posts() ) {
    $sticky_query->query->the_post();

        // LoopdeLoop

    }
}

$main_query = new WP_Query(array(
    // ...args galore
    'post__not_in' => $sticky_query->post_ids
));
```

### Version History

[](#version-history)

1.0.3 Fixed get\_stickies('query') argument returns full results when no IDs found Fixed get\_stickies('query') returns more results than expected

1.0.2 Added new function StickyPost::get\_stickies(\[string\] $type='ids', \[string\] $tax = false, \[int\], $term = false)

1.0.1 Added composer support

1.0.0 First release

0.0.3 Added new argument `post_types` to `StickyPost::query`Changed name from `stick posts to category` to `stick posts to term`

0.0.2 Added sticky filter in posts table Added options page to turn on/off taxonomies for post types

\##TODOS

- Add options panel
- \[option\] select enabled taxonomies
- Create code-free default functionality

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3532d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5bf92c14b9b8267aa83becc554597ba8b91fe91555f54dd85c1576c3386ff0c?d=identicon)[whitefiredesign](/maintainers/whitefiredesign)

---

Top Contributors

[![joebuckle-dev](https://avatars.githubusercontent.com/u/480898?v=4)](https://github.com/joebuckle-dev "joebuckle-dev (16 commits)")

### Embed Badge

![Health badge](/badges/whitefiredesign-wp-stick-posts-to-term/health.svg)

```
[![Health](https://phpackages.com/badges/whitefiredesign-wp-stick-posts-to-term/health.svg)](https://phpackages.com/packages/whitefiredesign-wp-stick-posts-to-term)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
