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 tool to enhance your site's SEO. It provides comprehensive analysis and optimization solutions, making SEO easier for WordPress users."

★★★★☆ (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 is designed to render breadcrumbs on your webpage. It provides a navigational trail for users, enhancing UX and SEO. This shortcode takes two optional parameters: ‘before’ and ‘after’. These allow you to insert custom text or HTML before and after the breadcrumb trail. If not specified, the breadcrumb will be displayed without any additional elements.

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 breadcrumb.
  • after – Text or HTML to be displayed after the breadcrumb.

Examples and Usage

Basic example – A simple usage of the SmartCrawl SEO plugin’s breadcrumbs shortcode. This will render the breadcrumb trail without any custom text before or after it.

[smartcrawl_breadcrumbs /]

Advanced examples

Adding custom text before and after the breadcrumb trail. This can be useful for providing additional context or information to your users. In this example, the breadcrumb trail will be rendered with “You are here: ” before it and ” – Thank you for visiting!” after it.

[smartcrawl_breadcrumbs before="You are here: " after=" - Thank you for visiting!"/]

Another advanced example includes using HTML tags within the ‘before’ and ‘after’ attributes. This can be useful for styling the breadcrumb trail. In this example, the breadcrumb trail will be rendered with a bold “Location: ” before it and a line break after it.

[smartcrawl_breadcrumbs before="Location: " after="
"/]

Please note that the ‘before’ and ‘after’ attributes accept any text or HTML, so you can customize the breadcrumb trail to fit your site’s design and requirements.

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 *