Organization chart Shortcode

Below, you’ll find a detailed guide on how to add the Organization chart 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 Organization chart Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Organization chart Plugin and the shortcodes it provides:

Plugin Icon
Organization chart

"Organization Chart is a dynamic WordPress plugin that allows users to visualize the structure of their team or business in an appealing, easy-to-understand format."

★★★★★ (6) Active Installs: 4000+ Tested with: 6.2.3 PHP Version: false
Included Shortcodes:
  • [wpda_org_chart]

Organization chart [wpda_org_chart] Shortcode

The WPDA Org Chart shortcode is an integral part of the plugin, enabling the display of organizational charts. This shortcode calls the ‘shortcode’ function, which instantiates the ‘wpda_org_chart_front_tree_maker’ class with the provided attributes. The ‘controller’ method then generates the required organizational chart.

Shortcode: [wpda_org_chart]

Examples and Usage

Basic example – Display an organization chart by referencing the ID of the chart.

[wpda_org_chart id=1 /]

Advanced examples

Display an organization chart with a specific theme and size. The chart will be rendered with the specified theme and the size will be adjusted according to the provided value.

[wpda_org_chart id=1 theme="dark" size="large" /]

Display an organization chart with a custom title. The title will be displayed at the top of the chart.

[wpda_org_chart id=1 title="Our Team" /]

Display an organization chart with a specific theme, size, and title. The chart will be rendered with the specified theme, the size will be adjusted according to the provided value, and the title will be displayed at the top of the chart.

[wpda_org_chart id=1 theme="dark" size="large" title="Our Team" /]

PHP Function Code

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

Shortcode line:

add_shortcode('wpda_org_chart', array($this, 'shortcode'));

Shortcode PHP function:

function shortcode($atts) {
		$tree = new wpda_org_chart_front_tree_maker($atts);
		return $tree->controller();
	}

Code file location:

organization-chart/organization-chart/front/front.php

Conclusion

Now that you’ve learned how to embed the Organization chart 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 *