Skip to content

shortcode This weekend view

1

Options to select “this weekend” view to create shortcodes to display only the next weekend’s events.
e.g Start date = today and end date “this weekend”

To do this perhaps you could get the weekend range like this:

function get_weekend_date_range($date) {
// Get the dates for the upcoming weekend (including Friday)
$friday = date(‘Y-m-d’, strtotime(‘next Friday’, strtotime($date)));
$saturday = date(‘Y-m-d’, strtotime(‘next Saturday’, strtotime($date)));
$sunday = date(‘Y-m-d’, strtotime(‘next Sunday’, strtotime($date)));

// Return the weekend date range
return “The weekend is from $friday to $sunday”;
}

Sahre
Tags

seriulian

Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis error dignissimos fugiat voluptas, asperiores quibusdam exercitationem id quam reiciendis expedita quidem nemo? Illo quod suscipit est possimus officiis repellendus eum.

Leave a Reply

Your email address will not be published.Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

Search
Categories
Subscribe
Socials