Smartcrawl SEO Shortcode

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

Before starting, here is an overview of the Smartcrawl Seo Plugin and the shortcodes it provides:

Plugin Icon
SmartCrawl WordPress SEO checker, SEO analyzer, SEO optimizer

"SmartCrawl WordPress SEO checker, SEO analyzer, SEO optimizer is an all-in-one solution enhancing your website's search engine visibility. This plugin simplifies SEO, boosts traffic, and improves your site's readability."

★★★★☆ (164) Active Installs: 20000+ Tested with: 6.3.2 PHP Version: 7.4.33
Included Shortcodes:
  • [smartcrawl_breadcrumbs]

Smartcrawl SEO [smartcrawl_breadcrumbs] Shortcode

The SmartCrawl SEO plugin shortcode, ‘smartcrawl_breadcrumbs’, generates breadcrumb navigation on your WordPress site. The PHP function ‘render_shortcode’ accepts ‘before’ and ‘after’ attributes, allowing customization of the breadcrumb’s display. This shortcode helps enhance user navigation and SEO.

Shortcode: [smartcrawl_breadcrumbs]

Parameters

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

  • before – Text or HTML to be displayed before the breadcrumbs
  • after – Text or HTML to be displayed after the breadcrumbs

Examples and Usage

Basic example – The shortcode can be used to render breadcrumbs on your website without any additional text before or after the breadcrumbs.

[smartcrawl_breadcrumbs /]

Advanced examples

Using the shortcode to render breadcrumbs with additional text before the breadcrumbs. The text “You are here: ” will be displayed before the breadcrumbs.

[smartcrawl_breadcrumbs before='You are here: ' /]

Using the shortcode to render breadcrumbs with additional text after the breadcrumbs. The text ” – Thank you for visiting our site” will be displayed after the breadcrumbs.

[smartcrawl_breadcrumbs after=' - Thank you for visiting our site' /]

Using the shortcode to render breadcrumbs with additional text both before and after the breadcrumbs. The text “You are here: ” will be displayed before the breadcrumbs and ” – Thank you for visiting our site” after the breadcrumbs.

[smartcrawl_breadcrumbs before='You are here: ' after=' - Thank you for visiting our site' /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'smartcrawl_breadcrumbs', array( $this, 'render_shortcode' ) );

Shortcode PHP function:

function render_shortcode( $atts = array() ) {
		$atts = shortcode_atts(
			array(
				'before' => '',
				'after'  => '',
			),
			$atts,
			'smartcrawl_breadcrumbs'
		);

		return $this->render_breadcrumb( $atts['before'], $atts['after'] );
	}

Code file location:

smartcrawl-seo/smartcrawl-seo/includes/core/breadcrumbs/class-controller.php

Conclusion

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