Event Calendar – Calendar Shortcode

Below, you’ll find a detailed guide on how to add the Event Calendar – Calendar Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Event Calendar – Calendar Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Event Calendar – Calendar Plugin and the shortcodes it provides:

Plugin Icon
Event Calendar – Calendar

"Event Calendar – Calendar is a reliable WordPress plugin that allows you to efficiently manage and display your events. With its intuitive interface, scheduling has never been easier."

★★★★☆ (101) Active Installs: 2000+ Tested with: 6.2.3 PHP Version: false
Included Shortcodes:
  • [Total_Soft_Cal]

Event Calendar – Calendar [Total_Soft_Cal] Shortcode

The Total Soft Calendar shortcode is a tool that generates a calendar event on your WordPress site. This shortcode allows you to call and display the Total Soft Calendar plugin’s functions. The PHP code related to this shortcode takes an “id” as an input, which defaults to “1” if not specified. This “id” corresponds to the specific calendar event you want to display. It then calls the Total_Soft_Draw_Cal function with the given “id”, effectively rendering the desired calendar event.

Shortcode: [Total_Soft_Cal]

Parameters

Here is a list of all possible Total_Soft_Cal shortcode parameters and attributes:

  • id – It’s the unique identifier for the specific calendar event.

Examples and Usage

Basic example – A simple usage of the Total_Soft_Cal shortcode to display the calendar with the ID of 1.

[Total_Soft_Cal id=1 /]

Advanced examples

Example of using the Total_Soft_Cal shortcode to display a calendar with a different ID. This allows you to have multiple calendars on your site and choose which one to display using the shortcode.

[Total_Soft_Cal id=2 /]

Another advanced usage could be to use the shortcode within a PHP function. This could be useful if you need to programmatically insert the calendar into your site, such as in a custom template file.


<?php
echo do_shortcode('[Total_Soft_Cal id=3 /]');
?>

Please note that in the shortcode [Total_Soft_Cal id=x /], ‘x’ is the ID of the calendar you want to display. Make sure to replace ‘x’ with the actual ID of your calendar.

PHP Function Code

In case you have difficulties debugging what causing issues with [Total_Soft_Cal] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('Total_Soft_Cal', 'Total_SoftCal_Short_ID');

Shortcode PHP function:

function Total_SoftCal_Short_ID($atts, $content = null)
	{
		$atts=shortcode_atts(
			array(
				"id"=>"1"
			),$atts
		);
		return Total_Soft_Draw_Cal($atts['id']);
	}

Code file location:

calendar-event/calendar-event/index.php

Conclusion

Now that you’ve learned how to embed the Event Calendar – Calendar Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

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