Note: This guide is taken directly from the Infuse help file. If you use Gutenberg on Wordpress, you might not be able to access it, so we've provided it here. (If you use the Classic Editor plugin, you can find this from the edit post screen, in the Help section)
Shortcodes are simple macros, surrounded by square brackets, that can be added to post content in WordPress. When one of these shortcodes is encountered in a post, it is replaced by the content provided by the shortcode provider. General information on shortcodes can be found on the Shortcodes page in the WordPress Codex.
SHE Media Infuse offers a simple shortcode, [shemedia_ad], that allows you to render ads in your posts. In addition to posts, it can be used in the standard theme files, such as your theme's header.php file, by calling the do_shortcode() function. Calling this function in your theme files allows you to use the same familiar shortcodes to place ads on all of your pages in areas that aren't covered by standard WordPress Widgets, such as a leaderboard at the top of a page or a supplemental ad between the post content and the comments.
Required Attributes
type
The type attribute specifies the type of ad that will be displayed. The following is a list of types that are supported by this shortcode, followed by the sizes of ad that are supported by that type:
banner
- Banner (728x90)flexbanner
- Flex Banner (728x90, 970x250, 970x90)medrec
- Medium Rectangle (300x250)flexrec
- Flex Rectangle (300x250, 300x600)tinybanner
- Tiny Banner (300x50, 320x50)sky
- Wide Skyscraper (160x600)mobileincontent
- Mobile In-content (300x250, 300x50, 320x50)wideincontent
- Wide In-content (300x250, 728x90)widestincontent
- Widest In-content (300x250, 728x90, 970x90, 970x250)
Example: The Shortcode [shemedia_ad type="medrec"] will be replaced by a 300x250 ad.
Optional Attributes
float
The float attribute allows the content to flow around the ad either to the left or right. The float attribute takes an argument of either left or right. If float="left" is used, the ad will float on the left side of the content, allowing the content to flow around the right side of the ad. Conversely, float="right" will cause the ad to float on right side of the content, and the content will flow around the left side of the ad.
div id
By default, the [shemedia_ad] shortcode will automatically generate an ID for the ad's container div. If you prefer to specify the ID of the div, you may pass this attribute. For example, [shemedia_ad type="banner" id="leaderboard-ad"] will display a 728x90 ad with a custom div ID of leaderboard-ad. If provided, the value must be unique.
class
You may pass arbitrary class names to this attribute. Any values passed here will be added to the class attribute of the ad's container div. These can be used to provide custom styling for the ad in your theme's CSS. The format for the class attribute is identical to that of a standard HTML tag. For example, class="class1 class2 class3" adds the three classes class1, class2, and class3 to your ad container div.
ad-callout
The ad-callout attribute shows the "ADVERTISEMENT" label above ads. The ad-callout attribute takes an argument of enabled. For example: [shemedia_ad type="banner" ad-callout="enabled"] will display a 728x90 ad with the ADVERTISMENT label above it.
If you have more questions, please reach out to support@shemedia.com for assistance.
Comments
0 comments
Article is closed for comments.