[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

bw_related by date

Use the bw_related shortcode to list related items based on a date field. Posts, pages and custom post types already have date fields for the publication date. There are times when it’s possible to use the publication date for the date of an event. But when there is more than one date – e.g. a start and end date or when the event is in the future then we need to use date fields to store the information. The bw_related shortcode enables you to list content relative to the stored date. For these examples we use the oik_todo post type ( from the oik-todo sample plugin ) and a number of TODO items that have been done and which are planned to be done.

Items in the past

For the items that are complete the start and end dates record the dates upon which the task was done.

[bw_related post_type=oik_todo meta_key=_oik_todo_start meta_compare="<" orderby=meta_value order=DESC numberposts=10 format="L _" fields="_oik_todo_start"&#93;
&#91;/bw_geshi&#93;

&#91;bw_related post_type=oik_todo meta_key=_oik_todo_start meta_compare="<" orderby=meta_value order=DESC numberposts=10 format="L _" fields="_oik_todo_start"&#93;


<h3>
Future items</h3>

For some of the future items the start and end dates are invented.
We need to have some far enough in the future to enable the examples to continue to work. Some of these TODO tasks should not be too arduous.

[bw_geshi html]
[bw_related post_type=oik_todo meta_key=_oik_todo_start meta_compare=">=" orderby=meta_value]
 

    Published: February 28, 2014 | Last updated: September 9, 2014

    Information

    Shortcode: bw_related – Display links to related content
    Letters:

    Syntax

    Syntax

    [bw_related
    post_type="| post type - Related post type"
    meta_key="| meta key - name of noderef field"
    meta_value="| meta value - the default value depends on the field type"
    format="| format string - field format string"
    by="| noderef field - name of a noderef field"]

    Other examples

    • bw_related – Other examples text widget
    • bw_related by matching noderef
    • bw_related via noderef values – different field names
    • bw_related with format= parameter
    • Display related posts by noderef field

    Plugins

    • All Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins

    Themes

    • FREE themes
    • Bespoke themes
    • Premium themes

    Blocks

    • All Blocks
    • Block examples
    • About Blocks

    Shortcodes

    • All Shortcodes
    • Shortcode examples
    • About Shortcodes

    Reference

    • About APIs
    • All APIs
    • All Classes
    • All Files
    • All Hooks

    Support

    • Contact
    • Cookies policy
    • Get API key
    • Privacy
    • Request support
    • Sitemap
    • Stay informed
    • Terms and Conditions
    oik-plugins
    Email: oikplug@oik-plugins.com

    Weight shipping plugins

    Find out which cart weight shipping plugin you need for your WooCommerce site.
    Which cart weight based plugin do I need?

    Site:  www.oik-plugins.com
    © Copyright oik-plugins 2011-2025. All rights reserved.


    Website designed and developed by Herb Miller of Bobbing Wide
    Proudly powered by WordPress and oik-plugins

    WordPress version: 6.8.3

    Gutenberg version: 21.7.0

    PHP version: 8.2.29