Make WordPress Core


Ignore:
Timestamp:
02/23/2026 08:36:50 PM (7 months ago)
Author:
joedolson
Message:

Twenty Twenty Five: Exclude sticky posts with query offsets.

Fix templates in Twenty Twenty Five that have multiple query posts with offsets to prevent displaying sticky posts. Sticky posts being enabled on multiple queries results in repeated content in each query.

Add "sticky":"ignore" to query block parameters.

Props poena, sabernhardt, abcd95, rinkalpagdar, freibergergarcia, akshat2802, mindctrl, ozgursar, joedolson.
Fixes #62975.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwentyfive/patterns/template-home-with-sidebar-news-blog.php

    r59348 r61720  
    2121                <!-- wp:column {"width":"75%"} -->
    2222                <div class="wp-block-column" style="flex-basis:75%">
    23                         <!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false}} -->
     23                        <!-- wp:query {"query":{"perPage":1,"pages":0,"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false}} -->
    2424                        <div class="wp-block-query">
    2525                                <!-- wp:post-template -->
     
    7272        <div style="height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>
    7373        <!-- /wp:spacer -->
    74         <!-- wp:query {"query":{"perPage":4,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
     74        <!-- wp:query {"query":{"perPage":4,"pages":0,"offset":"7","postType":"post","order":"desc","orderBy":"date","author":"","search":"","exclude":[],"sticky":"ignore","inherit":false,"taxQuery":null,"parents":[]},"align":"wide"} -->
    7575        <div class="wp-block-query alignwide">
    7676                <!-- wp:post-template -->
Note: See TracChangeset for help on using the changeset viewer.