| 开发者 |
mykytadudariev
measuredcode |
|---|---|
| 更新时间 | 2026年11月6日 17:28 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
/wp-content/plugins/, and activate it.The core Group block with its Row, Stack and Grid variations, the Column block and the Cover block. Other blocks, such as Columns as a whole or Media & Text, are not supported out of the box.
Developers can add blocks with the wholelink_supported_blocks filter, for example in a theme's functions.php:
add_filter( 'wholelink_supported_blocks', function ( $blocks ) { $blocks[] = 'core/media-text'; return $blocks; } );
The block then gets the same link button and settings. Only Group, Column and Cover are tested: a block added this way needs a single outer element, and some blocks may need extra CSS before clicks reach the link, so check it on your site.
The button appears when the Group, Column or Cover itself is selected, not a heading or paragraph inside it. Click inside the block, then press Select parent (the first button of the block toolbar) until the toolbar shows Group, Row, Column or Cover, or pick the block in List View. The button is also in the block settings as Add link.
Put the card's content in a Group inside the Query Loop's post template, select that Group, press the link button and choose Link to this post, or turn it on under Whole block link in the block settings. The option shows only inside a post template. If you move such a block out of the Query Loop, it is no longer a link, and the block settings offer to remove the setting.
Not by dragging with the mouse: the link covers the whole block, so dragging over the text drags the link instead. Clickable cards built from a plain HTML link behave this way; the alternative, a click handler in JavaScript, is invisible to search engines and breaks middle-click.
Nothing breaks. The blocks open in the editor without "unexpected or invalid content" warnings and show on your site as before, just without the link. Wholelink stores nothing outside the blocks. If you activate it again, the links come back, unless you saved the post in the meantime: the editor then drops the link settings it no longer knows.
It works with block themes and classic themes, as long as the theme shows the block editor's Group, Column and Cover blocks. Its few lines of CSS load only on pages with a linked block. With a classic theme on WordPress before 6.9 they load at the end of the page, which works the same.
Only in the block editor. On the front end the link is plain HTML with a few lines of CSS.