Date Range Extension

Overview

The Date Range extension adds the ability to display posts or events from a specific date range. You can set date ranges to either be absolute (eg: November 1st – November 8th) or relative (eg: 1 week ago – today).

The extension give you the power to create daily, weekly, monthly or yearly feeds of your posts using separate shortcodes to display posts from different date ranges in each.

See the How to Use tab above for more information and examples of how to use the extension.

Below is an example of the Date Range extension used to show events by month.

date-range-extension

 

Shortcodes used above:

March

[custom-facebook-feed type=events from="03/01/14" until="03/31/14"]

April

[custom-facebook-feed type=events from="04/01/14" until="04/30/14"]

See the How to use tab above for directions on how to use the extension.

How to use

Installation

Extensions are installed just like any other WordPress plugin. You can follow the same process used when uploading and installing the Custom Facebook Feed Pro plugin.

Settings Page

Once activated the extension will allow you to set a ‘From’ and ‘Until’ date range to allow you to show posts or events only from between those specific dates.

If you set an ‘Until’ date but don’t set a ‘From’ date then it will display posts from today’s date until the date you set.
If you set a ‘From’ date but don’t set an ‘Until’ date then it will display posts from the date you set until today’s date.
If you don’t set either then the date range won’t be applied.

date-range-screenshot

Shortcode

The Date Range extension also allows you to specify a date range directly in your shortcode like so:

[custom-facebook-feed from="mm/dd/yy" until="mm/dd/yy"]

This then allows you to create separate feeds of posts or events by month like so:

February
[custom-facebook-feed type=events from="02/01/14" until="03/01/14"]

March
[custom-facebook-feed type=events from="03/01/14" until="04/01/14"]

April
[custom-facebook-feed type=events from="04/01/14" until="05/01/14"]

Relative/Moving Dates

The extension also allows you to display posts from relative/moving dates. For example, you could display all posts from the past day by using the following shortcode:

[custom-facebook-feed from="-1 day" until="now"]

Relative dates can only be set via the shortcode and not on the plugin’s Settings page. Below are some other shortcode examples.

Posts from the past two weeks: [custom-facebook-feed from="-2 weeks" until="now"]

Posts from the past month: [custom-facebook-feed from="-1 month" until="now"]

Posts from the last 12 hours: [custom-facebook-feed from="-12 hours" until="now"]

Posts from the last 24 hours to the last 12 hours: [custom-facebook-feed from="-1 day" until="-12 hours"]

Future Event Ranges

You can also show upcoming events from a specific date range, for example to show all events for the coming 2 weeks use:

[custom-facebook-feed type=events eventsource=eventspage from="now" until="+2 weeks"]

Shortcode Options

Name Attribute Options Description Example
From from mm/dd/yy
-x minutes
-x hours
-x days
-x weeks
-x months
The date to display posts from
The number of minutes ago
The number of hours ago
The number of days ago
The number of weeks ago
The number of months ago
from=”02/15/14″
from=”-15 minutes”
from=”-1 hour”
from=”-2 days”
from=”-3 weeks”
from=”-1 month”
Until until mm/dd/yy
now
-x minutes
-x hours
-x days
-x weeks
-x months
The date to display posts until
Display posts up until now
The number of minutes ago
The number of hours ago
The number of days ago
The number of weeks ago
The number of months ago
until=”02/20/14″
until=”now”
until=”-15 minutes”
until=”-1 hour”
until=”-2 days”
until=”-3 weeks”
until=”-1 month”