The hitmouse_link shortcode allows you to dynamically insert links into your WordPress posts or pages. The links are generated based on the specified id or slug and can be customized with additional attributes.
You can add the hitmouse_link shortcode directly into the content of your posts or pages using the following syntax:
[hitmouse_link id="123" title="Click Me!" class="custom-class"]
id (optional)The id specifies the unique identifier of the link in your database. If both id and slug are provided, the id takes precedence.
Example:
[hitmouse_link id="123"]
This will generate a link based on the record with ID 123.
slug (optional)The slug is a URL-friendly string that uniquely identifies the link. It is used if the id attribute is not specified.
Example:
[hitmouse_link slug="my-custom-slug"]
This will generate a link using the slug my-custom-slug.
title (optional)The title specifies the anchor text (visible text) of the link. If not provided, the title from the database is used.
Example:
[hitmouse_link id="123" title="Visit Our Site!"]
This will display the link with the text Visit Our Site!
class (optional, default: hitmouse-link)The class adds custom CSS classes to the link for styling purposes.
Example:
[hitmouse_link id="123" class="btn btn-primary"]
This will generate a link with the classes btn btn-primary.
The shortcode generates an HTML <a> tag with the attributes and values specified. Depending on the database configuration for the link, the rel and target attributes are also included.
[hitmouse_link id="42" title="Learn More"]
Generated Output:
<a href="https://example.com/affiliate/slug-for-id-42" class="hitmouse-link" target="_blank" rel="nofollow">Learn More</a>
[hitmouse_link slug="custom-slug" title="Shop Now"]
Generated Output:
<a href="https://example.com/affiliate/custom-slug" class="hitmouse-link" target="_self">Shop Now</a>
[hitmouse_link id="42" class="btn btn-success"]
Generated Output:
<a href="https://example.com/affiliate/slug-for-id-42" class="btn btn-success" target="_blank" rel="nofollow sponsored">Default Title</a>
[hitmouse_link id="999"]
Generated Output:
Invalid link ID or slug.
Ensure that the shortcode feature is enabled in the plugin settings. If the shortcode feature is disabled, no link will be rendered.
id should be a positive integer.slug should be sanitized and URL-safe.class attribute.Customize the appearance of the links using the provided class attribute or by targeting the default class hitmouse-link in your CSS file.
If neither id nor slug is valid, a fallback message (Invalid link ID or slug.) is displayed. This prevents broken or empty links from appearing.
You can use the shortcode to insert affiliate links dynamically into your content, allowing you to track and manage them through the plugin.
[hitmouse_link id="10" title="Buy Now" class="btn btn-buy"]
Insert links with custom slugs for promotional campaigns and track their performance.
[hitmouse_link slug="holiday-sale" title="Holiday Sale!"]
id or slug exists in the database.id or slug values.title is missing, the plugin will use the title stored in the database for the link.class is missing, the default CSS class (hitmouse-link) will be applied.For additional help or questions about using the shortcode, visit the HitMouse Documentation or contact our support team at support@hitmouse.pro.