Skip to main content
Signocore
// signocore seo docs

Shortcodes and blocks

Shortcodes and blocks in Signocore SEO: breadcrumbs, reading time and the table of contents block.

Signocore SEO has three shortcodes and one block. You can place a shortcode in a Shortcode block, in the classic editor or in a theme template:

<?php echo do_shortcode('[signocore-breadcrumbs]'); ?>
[signocore-breadcrumbs]

Shows the breadcrumb trail for the current page. The shortcode has no attributes.

The trail starts with Home and follows the page's place in your site: the blog or shop page, the category (the primary category when a post has several) and parent pages. The current page comes last, as plain text. Each step uses the Breadcrumb Title from its SEO box when you set one, otherwise its normal title. On a 404 page, the shortcode shows nothing.

The output looks like this:

<div class="breadcrumbs"><a href="https://example.com">Home</a> <span class="sep" aria-hidden="true">&rsaquo;</span> <a href="https://example.com/category/guides/">Guides</a> <span class="sep" aria-hidden="true">&rsaquo;</span> How to choose a sofa</div>

There are no appearance settings. Style the .breadcrumbs and .sep classes in your theme's CSS, or let a developer change the wrapper and separator with wpsseo_breadcrumb_args and the trail with wpsseo_breadcrumb_structure.

The same trail is added to every page as structured data, whether or not you use the shortcode. See Structured data.

Reading time

[signocore-reading-time]
[signocore-reading-time post_id="42"]

Shows the estimated reading time of a post as plain text, such as "4 minutes". The estimate uses the word count and how hard the text is to read, between 120 and 300 words per minute.

Attribute Default What it does
post_id The current post The ID of the post to measure.

Outside a post, and without post_id, the shortcode shows nothing. The value is cached and refreshed when you save the post.

Table of contents

The table of contents is built from the headings in the post content each time the page loads, so it always matches your current headings. Headings inside groups and columns are included.

Headings need an anchor for the links to jump to. In posts that contain the block or the shortcode, headings without an anchor get one made from their text, with -2, -3 and so on added when two headings share a text. Anchors you set yourself are kept.

Note: The table of contents needs the PHP dom extension. Without it, the block and the shortcode are not available, and administrators see a notice. Ask your host to enable it, or see Troubleshooting.

The Table of Contents block

Add the Table of Contents block from the Signocore category. The editor shows a live preview of your headings. The settings sidebar has two panels:

Setting Panel Default What it does
Heading H2, Heading H3, Heading H4 Headings H2 and H3 Heading levels to list. Select at least one.
List style Appearance Numbered (ordered) Numbered (ordered) or Bulleted (unordered).
Title Appearance Empty Optional heading shown above the list. Leave it empty to hide it.
Maximum depth Appearance 3 From 1 to 4. How many of the selected levels to show, counted from the top.
Smooth scroll Appearance On Scrolls smoothly to a heading when a visitor clicks a link, unless the visitor's device asks for reduced motion.
Collapsible Appearance Off Lets visitors fold the list away. It starts open, with the title (or "Table of contents") as the toggle.

Maximum depth counts the levels you select, not heading numbers. With H2, H3 and H4 selected and a depth of 2, the list shows H2 and H3. Deeper headings nest under the one before them.

The block also supports an HTML anchor, wide and full alignment, and margin and padding. When the post has no matching headings, the block shows nothing on the page.

The shortcode

[signocore-toc]

The shortcode shows the same table of contents where blocks are not an option. Place it in the content of the post itself, because heading anchors are only added to posts that contain the block or the shortcode.

Attribute Default Allowed values
levels 2,3 Heading levels 2 to 6, separated by commas.
list ol ol for a numbered list, ul for a bulleted list.
title Empty Any text, shown above the list.
smooth true true or false. 1, yes and on also count as true, anything else as false.
collapsible false true or false, read the same way as smooth.
depth 3 1 to 4. Values outside that range are set to the nearest limit.

For example, a bulleted list of H2 to H4 headings that visitors can fold away:

[signocore-toc levels="2,3,4" list="ul" title="On this page" depth="3" collapsible="true"]

Stuck on something the docs don't cover?

Questions go straight to the developer who builds the plugins. Replies usually within a day.

September Sale

€20 off Signocore SEO Pro

Pay €49 instead of €69, one time for unlimited sites. code SEP20