GCal Days

GCal Days

Wordpress plugin

Install on Wordpress

App Details

This plugin provides a shortcode and a set of functions to return the number of days since the most recent past event in your Google Calendar matching specified search terms. The shortcode can also be used to return the number of days until the closest upcoming event matching specified search terms.

The Shortcode

[gcal-days search="" type="" id=""] 

The shortcode name is gcal-days. It has three attributes, but only one of which is absolutely necessary:

  • search: (Required.) The search term.
  • type: (Optional.) The direction in time to search. Defaults to “since”, which searches past events. “until” will search future events.
  • id: (Conditionally optional.) The ID of the calendar to search. You can discover the IDs of calendars via the plugin’s settings page. This shortcode attribute can only be optionally omitted from shortcodes if you define a default calendar in the plugin’s settings.

The shortcode outputs a number representing the number of days until a matching event. If no event is found, a -1 will be displayed.

Examples: [gcal-days search="dentist"], [gcal-days type="until" search="vacation" id="[email protected]"]

Links: Plugin Homepage | Plugin Directory Page | Author Homepage

Functions

The plugin provides two functions for use in your theme templates, functions.php, or in plugins.

Functions

  • <?php function gcal_days_since( $search, $calendar_id = '' ) ?>
  • <?php function gcal_days_until( $search, $calendar_id = '' ) ?>

Arguments

  • $search (string)
    Required. The word or phrase to search for

  • $calendar_id (string)
    Optional. The ID for the Google Calendar. Check the plugin’s settings page for calendar IDs. This argument is only optional if you have defined a default calendar via the plugin’s settings.

Return Value

An integer value of the number of days since/until the matching event. -1 is returned if no event was found or an error was encountered.

Examples

  • <?php // Days until next dentist appointment
    $days_until = gcal_days_until( 'dentist' );
    ?>

  • <?php
    // Get the days since my last day off
    $days_since = gcal_days_since( 'day off' );
    // Echo a message using that number
    if ( -1 == $days_since ) {
    echo "You've never had a day off?! Take one soon!";
    } else {
    printf( _n( 'Your last day off was %d day ago.', 'Your last day off was $d days ago.', $days_since ), $days_since );
    }
    ?>

Pricing

Starting from $0 per month.

Check Out the Creative Card Carousel Widget

By Common Ninja

Creative Card CarouselTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

calendar
gcal
google
shortcode

Developed By

Scott Reilly

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Creative Card Carousel for Wordpress logo

Creative Card Carousel

Showcase content with a creative card carousel that rotates banner style items to highlight offers and important messages.

Announcements for Wordpress logo

Announcements

Add announcements to your site to share important updates, keep visitors informed, and guide them toward actions that support engagement and conversions.

WordPress Feed for Wordpress logo

WordPress Feed

Show WordPress posts with a WordPress feed that keeps content fresh, improves navigation, and helps visitors discover more of your site.

Scroll to Element Button for Wordpress logo

Scroll to Element Button

Scroll to element button that improves navigation by letting visitors jump directly to key sections, reducing friction and boosting overall engagement.

Animated Headline for Wordpress logo

Animated Headline

Add animated headlines to draw attention to key messages and improve user engagement through visual emphasis.

FAQ for Wordpress logo

FAQ

Add an FAQ section to your site to answer common questions, reduce support requests, and give visitors a smoother and more confident user experience.

Slideshow for Wordpress logo

Slideshow

Present images in a Slideshow carousel that rotates or slides through visuals, helping you highlight key content within a clean, engaging layout.

Linkedin Feed for Wordpress logo

Linkedin Feed

Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.

YouTube Feed for Wordpress logo

YouTube Feed

Show YouTube videos in a customizable YouTube feed that keeps content fresh, boosts watch time, and helps visitors explore more of your channel.

PDF Viewer for Wordpress logo

PDF Viewer

Add a PDF viewer to your site to display documents, share product information, and give visitors easy access to helpful content in one place.

Card Carousel for Wordpress logo

Card Carousel

Showcase content with a card carousel that combines images and text, improves visual design, and helps visitors explore key information.

Course Registration Form for Wordpress logo

Course Registration Form

Use a scroll progress bar that visually tracks reading on the page, improves navigation, and keeps visitors aware of their position.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms