You can change the inline content share buttons position, but this isn’t always perfect with all of the different themes and frameworks out there. Therefore, you can also use a shortcode. We also have a filter coming too.
Inline content share buttons shortcode
The shortcode is:
You can place this anywhere you want on your site, however you will also need to set the button position and post types.
If you are using a shortcode, set the button position to “Don’t add to content.” Otherwise, you might get two sets of buttons showing up.
You also need to set the post types where you want your shortcode to display.
Why do you need to set the post types? It’s true, with most plugins, if you drop in a shortcode it will simply work anywhere without any additional settings. However, the caveat is, they have to add their code across your entire site (external or inline CSS), anticipating you adding a shortcode at some point in time.
Doing it our way allows us to keep the code off any post types where you aren’t specifically using the shortcode. This was a performance-driven decision to keep your page weight as minimal as possible when it’s not needed.
You can follow the example below on how to display your inline content share buttons with a shortcode in the GeneratePress theme. It will vary per theme or page builder. You can check their documentation on how to use a shortcode.
GeneratePress uses what are called elements. So first we create a new element hook.
Name your element and drop the shortcode in it:
Select where you want the hook to appear. There are a number of different choices, such as before_content, after_content, after_entry_title, etc. It all depends on where you want it. Then check the “Excute Shortcodes” option.
You can change the positioning within the hook placement by wrapping it with a little HTML and CSS. Here are a couple of examples.
Add top margin
Add bottom margin
Under the “Display Rules” tab, choose the location for the hook/shortcode to appear. For example, choose all of your posts.
Click “Publish” and verify on your site that it’s where you want it.