Linux 软件免费装
Banner图

Query Loop Exclude Current Post

开发者 smallplugins
oncecoupled
zafark
更新时间 2026年11月19日 00:11
捐献地址: 去捐款
PHP版本: 5.6 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

related posts exclude query loop query block current post

下载

0.0.8

详情介绍:

A "You might also like" section at the bottom of a post usually pulls from the same category as the post itself, which means the post someone is already reading often shows up in its own related list. This plugin adds a single toggle to the Query Loop block called Exclude Current Post. Switch it on and that loop leaves out whichever post is being viewed, so the list always shows something else. How it works No settings page There is nothing to configure. The plugin adds the one toggle to the Query Loop block and does nothing else. Works alongside post selection plugins If another plugin has already narrowed a loop down to a hand-picked set of posts, the current post is removed from that set rather than being ignored.

安装:

  1. In your WordPress admin, go to Plugins > Add New and search for "Query Loop Exclude Current Post".
  2. Click Install Now, then Activate.
  3. Edit any post, page or template containing a Query Loop block, select the block, and turn on Exclude Current Post in the block settings sidebar.
To install manually, upload the plugin folder to /wp-content/plugins/ and activate it from the Plugins screen.

常见问题:

Where is the setting?

Select a Query Loop block in the editor and open the settings sidebar on the right. There is a panel called Exclude Current Post with a single toggle inside it.

I do not see the toggle on my Query Loop block

The toggle only appears when the Query Loop uses its own query. If Inherit query from template is switched on, the block is showing the page's main query, such as an archive or search results, where there is no single post being viewed to exclude. Switch inheriting off and the toggle appears.

Does it affect the other Query Loops on the page?

No. The setting is stored on each block separately, so turning it on for one loop leaves every other loop on the page exactly as it was.

Will my related posts section end up one short?

No. The current post is excluded before the posts-per-page limit is applied, so a loop set to show three posts shows three other posts.

Does it work with custom post types?

Yes. The plugin does not care which post type a loop is querying.

Does it work with the Classic Editor or with shortcodes?

No. This plugin extends the Query Loop block, so it needs the block editor.

Does it slow my site down?

No. It adds the current post's ID to the query's exclusion list, which is a normal part of how WordPress builds a query.

更新日志:

0.0.8 0.0.7 0.0.6 0.0.5