Comfortable Reading Shortcode

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

Before starting, here is an overview of the Comfortable Reading Plugin and the shortcodes it provides:

Plugin Icon
Comfortable Reading

"Comfortable Reading is a user-friendly WordPress plugin designed to enhance your site's readability. It optimizes text size, spacing, and layout to provide a seamless reading experience."

★★★☆✩ (11) Active Installs: 3000+ Tested with: 4.9.24 PHP Version: false
Included Shortcodes:
  • [cr]

Comfortable Reading [cr] Shortcode

The Comfort Reading (CR) shortcode is a useful tool for enhancing the user experience. This shortcode allows you to add a caption to any content on your WordPress site. When used, it wraps the provided content within an anchor tag, making the content clickable. This can be useful for providing additional information or linking to related content.

Shortcode: [cr]

Examples and Usage

Basic example – The shortcode [cr] can be used to create a hyperlink with a custom caption. The content enclosed within the shortcode will be used as the caption for the link.

[cr]Click Here[/cr]

Advanced examples

1. The shortcode [cr] can be extended to include additional attributes. Here, we’re using the ‘url’ attribute to specify the destination of the hyperlink. The content within the shortcode will be used as the caption for the link.

[cr url="https://www.example.com"]Visit our website[/cr]

2. The shortcode [cr] can also be used with multiple parameters. In this example, we’re adding a ‘target’ attribute to specify where the new page should be opened. The ‘_blank’ value will open the link in a new tab or window.

[cr url="https://www.example.com" target="_blank"]Visit our website[/cr]
Please note that these advanced examples will only work if the ‘caption_shortcode’ function is modified to accept and handle these additional parameters.

PHP Function Code

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

Shortcode line:

add_shortcode( 'cr', 'caption_shortcode' );

Shortcode PHP function:

                    function caption_shortcode( $atts, $content = null ) {
   return '<a href="#" id="cr_version_link">' . $content . '</a>';
}
                    

Code file location:

comfortable-reading/comfortable-reading/comfortable-reading.php

Conclusion

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