Hit enter to search or ESC to close
The PHP code in this downloads folder enables you to add one or 2 buttons to all single posts and pages without modifying the HTML for each button link.
You can also add a unique link for each button and specify which button links open in the same or new window. If not specified, button links will open in the same window.
pay attention : The solution you see in the demo video uses WordPress’ native custom fields. If you prefer to use a plugin like ACF, read the last section at the end of this tutorial to learn how to easily setup ACF to control your button elements.
Shows you how to setup custom fields in WordPress so that you can add 1 or more buttons with custom button text and custom links, or open a new window in the Genesis child theme.
Tested by StudioPress using Essence Pro child theme, however if you change it will work in any Genesis child theme or any WordPress theme. essence_entry_header Hooks for any theme specific or WordPress hook.
There are 2 steps:
Buttons are displayed only when each custom field is key button_primary_text and/or button_text is a text value otherwise none is shown.
By default, links open in the same window and only open in a new window if each custom field is keyed. primary_window and/or secondary_window Has a value of 1 as seen in the screenshot above.
Install the free or premium version of the ACF plugin and import the file named 107304-acf.json, You can then use the stylized fields on a single edit screen to configure your buttons.
This allows you to use ACF to open links in the same window or a new window.
About the author