Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

WordPress’s built-in sticky-post feature works only with the standard post type; it does not pin custom post types on their archives. To feature items in a custom post type archive, create a separate feature flag for that type and either move flagged items to the top of the archive’s main query or show them in a distinct featured section. The right choice depends on whether featured items should remain part of one paginated list.

Why WordPress sticky posts do not work for custom post types

In WordPress, “sticky” has a specific built-in meaning: a regular post can be pinned to the top of the posts front page. The Theme Handbook states that “This feature is only available for the built-in post type post and not for custom post types.” See WordPress’s Sticky Posts documentation.

The core sticky_posts option is therefore not a general-purpose feature list for arbitrary post types. For a custom type such as portfolio, event, or product, add a separate per-item feature state using metadata or another field managed by your site’s plugin or theme logic. Then use that state to control the archive display.

Choose how featured items should appear

Approach Reader experience Pagination considerations Best fit
Modify the archive’s main query Featured items are part of one archive list and ordered ahead of other items. Keep the archive’s normal query and pagination behavior. The archive should be one unified list.
Add a separate featured section Featured items appear in a visually distinct block above the regular archive. Exclude featured items from the regular loop and decide whether they count toward the page size. The design calls for a separate promoted area.

For one continuous archive, changing the main query is usually the simpler model. A separate query is useful when the featured area needs its own layout, but it creates extra work to prevent duplicates and make page boundaries predictable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the custom post type and archive template

WordPress supports a custom archive template named archive-{post_type}.php, where {post_type} is replaced with the registered post-type key. For a type registered as portfolio, the template is archive-portfolio.php. If the theme uses a shared archive template, check for the relevant post-type archive there instead. See the Custom Post Types Plugin Handbook.

Registering a custom post type does not automatically insert its items into the main query for every archive or page. Confirm that the post type has an archive and that the template being rendered is the one you intend to change. Keep the feature flag’s storage and editing interface in the site’s existing plugin or theme architecture so it remains consistent with the rest of the site.

Put featured items first in the archive

When the archive should stay a single list, use pre_get_posts to adjust the existing query before WordPress runs it. Scope the change to the front-end main query and the intended post type archive. WordPress documents these query checks and the hook’s timing in its pre_get_posts reference.

  1. Add a feature flag. Create a per-item field or metadata value for the custom post type. Decide how editors set and clear it; do not treat the built-in sticky_posts option as the custom type’s feature list.
  2. Target the archive query. In the pre_get_posts callback, ensure the query is not in the administration area, is the main query, and is the archive for the intended custom post type. Use the target site’s registered post-type key.
  3. Apply featured-first ordering. Adjust the query to order items using the feature state, then retain the intended secondary ordering, such as the archive’s existing date order. The precise query arguments depend on how the feature value is stored and on the site’s WordPress version and query structure.
  4. Test the archive and its pages. Check that featured entries lead the list, non-featured entries follow in the expected order, and navigation still reaches the right items on later pages.

Use the existing main query for this design rather than building a second archive loop. WordPress’s WP_Query reference documents query arguments and pagination behavior; the exact metadata query and ordering implementation should fit the site rather than be copied as a universal drop-in snippet.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Build a separate featured section

If featured items need a different visual treatment, render a dedicated featured block above the normal archive loop. In the template, run a separate query for featured items of the current custom post type, then make sure those same items do not appear again in the regular loop.

  • Choose whether featured items count toward the archive’s per-page item count. If they do, account for their number when deciding how many regular items to show; if they do not, explain the resulting page length through the design.
  • Exclude featured entries from the regular query across all pages, not just the first page.
  • Test the first page and at least one later page for missing items, duplicates, and incorrect navigation.

Avoid adding an offset merely to skip the featured entries. WordPress warns that using an offset can break pagination unless you handle the paging calculation manually. The warning and related query guidance are in the pre_get_posts documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check pagination and query context

The archive’s main query normally handles its own page count and navigation. Preserve that behavior when changing its order. For a separate query, make deliberate choices about page size, exclusions, and how featured entries affect the regular archive’s boundaries.

Pagination context can differ between an ordinary post-type archive and a static-front-page template. WordPress query code may use paged; a static-front-page template can require the page query variable instead. Consult the WP_Query documentation and verify which query context the target template uses before reusing pagination code.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which implementation should you use?

  • Choose a main-query ordering change when featured items should simply lead the same archive list.
  • Choose a separate featured block when the design needs a distinct layout, and explicitly handle duplicate suppression and page-size behavior.
  • In either design, use a custom feature field for the custom post type, scope query changes narrowly, and test pagination on the actual site.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.