[next_post]

The shortcode is designed to display a link to the next post.


Product


Shortcode Attributes

  1. label – The text label displayed for the next post link.
    • Default: Next.
    • Options: Any text value.
  2. taxonomy – Specifies the taxonomy to filter the next post.
    • Options: category, post_tag, or custom taxonomy.
  3. data – Used to control what data show. Allow multiple values.
    • Options: title, image, date. Use commas to separate.
  4. layout – Specifies the layout style for the next post link.
    • Default: 1.
    • Options:
      • 1 –  image above content;
      • 2 – image left content;
      • 3 – image right content.

Example Usage

Example 1

[next_post]

Results

<span class="hic-post-meta-nav next-nav layout-1">
    <a href="https://example.om/next-post/" rel="next">
        <span class="nav-box">
            <span class="nav-content">
                <span class="nav-label">Next</span>
            </span>
        </span>
    </a>
</span>
This example will display a simple “Next” link to the next post.
The shortcode only works on single post pages (is_single()). If used on other pages, it will return an empty string.

Example 2

[next_post label="Read Next"]

Results

This example displays changing the label to “Read more”.

Example 3

[next_post data="image,title"]

Results

<span class="hic-post-meta-nav next-nav layout-1">
    <a href="https://example.om/next-post/" rel="next">
        <span class="nav-box">
            <span class="nav-image-container">
                <span class="hic-image" style="background-image: url(https://example.om//wp-content/uploads/2023/07/image.jpg);"></span>
            </span>
            <span class="nav-content">
                <span class="nav-label">Next</span>
                <span class="hic-title"><h3>Next Post Title</h3></span>
            </span>
        </span>
    </a>
</span>
This example will display the featured image and title of the next post.
If the data parameter is not provided, only the label will be displayed.

Example 4

[next_post label="Read Next" taxonomy="category" data="title,image" layout="2"]

Results

<span class="hic-post-meta-nav next-nav layout-2">
    <a href="https://example.om/next-post/" rel="next">
        <span class="nav-box">
            <span class="nav-image-container">
                <span class="hic-image" style="background-image: url(https://launch.test/wp-content/uploads/2023/07/image.jpg);"></span>
            </span>
            <span class="nav-content">
                <span class="nav-label">Read Next</span>
                <span class="hic-title"><h3>Next Post Title</h3></span>
            </span>
        </span>
    </a>
</span>
This example will display a Read Next link with the next post’s title and featured image, filtered by the same category, using layout style 2.