Add Reactions to Content Body Using Shortcodes
Incorporating a custom block of reactions directly within the content of an article can significantly enhance user engagement. The DaReactions plugin allows you to easily insert these reaction blocks using a shortcode, which can be customized to fit specific parts of your content, such as paragraphs or images.
How to Use the Reactions Shortcode
The shortcode for adding reaction blocks is straightforward and can accept up to two parameters for customization:
- id: A numeric identifier for the reaction block. The default value is 1, but you should specify a unique ID for each usage to differentiate multiple reactions within the same content.
- type: The type of content the reactions are associated with. The default value is "post", but it can be set to other content types like "paragraph" or "image".
Examples of Using the Reactions Shortcode
- Adding to a Specific Paragraph:
To add a reaction block to a specific paragraph, use the shortcode with a unique ID and set the type to "paragraph":
[reactions id="2" type="paragraph"]
- Adding to an Image:
To enable reactions for an image within your article, use:
[reactions id="3" type="image"]
- Replicating Reactions for Existing Content:
If you want to replicate the same reactions setup as another piece of content, simply use the same
id
andtype
values that correspond to that content. For example, to replicate reactions for a post with ID 125:[reactions id="125" type="post"]
Tips for Using Reactions Shortcodes
- Unique IDs: Ensure each use of the shortcode has a unique ID if multiple reaction blocks are used within a single post or page to avoid conflicts.
- Testing: After inserting shortcodes, preview your post or page to ensure the reactions appear as expected and function correctly.
By utilizing shortcodes to add reactions to specific content elements, you can create a more interactive and engaging user experience, tailored to highlight key sections of your articles or features within your site.