Below, you’ll find a detailed guide on how to add the Service Box Showcase 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 Service Box Showcase Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Service Box Showcase Plugin and the shortcodes it provides:
"Service Box Showcase is a versatile WordPress plugin designed to present your services or products in a sleek, customizable box format. Its flexibility enhances your site's aesthetics and functionality."
- [WPSM_SERVICEBOX]
Service Box Showcase [WPSM_SERVICEBOX] Shortcode
The WPSM_SERVICEBOX shortcode is used to add a service box to your WordPress site. It takes an ‘id’ as an argument, which specifies the service box to display. The PHP function associated with this shortcode ensures that if no ‘id’ is provided, no service box is shown. It then retrieves the content from ‘content.php’ and displays it on the site.
Shortcode: [WPSM_SERVICEBOX]
Parameters
Here is a list of all possible WPSM_SERVICEBOX shortcode parameters and attributes:
id
– It’s the unique identifier for the specific service box
Examples and Usage
Basic example – Enables you to display a specific service box by referencing its ID.
[WPSM_SERVICEBOX id=1 /]
Advanced examples
Using the shortcode to display multiple service boxes by referencing their IDs. This allows you to showcase a variety of services on a single page.
[WPSM_SERVICEBOX id=1,2,3 /]
Using the shortcode without specifying an ID. This will display all service boxes available on your site.
[WPSM_SERVICEBOX /]
PHP Function Code
In case you have difficulties debugging what causing issues with [WPSM_SERVICEBOX]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'WPSM_SERVICEBOX', 'WPSM_SERVICEBOX_ShortCode' );
Shortcode PHP function:
function WPSM_SERVICEBOX_ShortCode( $Id ) {
ob_start();
if(!isset($Id['id']))
{
$WPSM_SERVICE_ID = "";
}
else
{
$WPSM_SERVICE_ID = $Id['id'];
}
require("content.php");
wp_reset_query();
return ob_get_clean();
}
Code file location:
service-box/service-box/template/shortcode.php
Conclusion
Now that you’ve learned how to embed the Service Box Showcase 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.
Leave a Reply