Shortcodes make the main content on your Jupiter website. Every shortcode has its own functionality and styling, most of it is configurable in the shortcode settings. However, if you need more customization, one way is to override a shortcode in the child theme.
In this article, we’ll explain about overriding shortcodes in the child theme.
In this article
In the Jupiter theme there is a Shortcodes directory which is located in wp-content > themes > jupiter > components > shortcodes in your web host.
The shortcodes directory contains all of the shortcode files, each responsible for a specific shortcode. The names are intuitive and you will be able to identify which file is for which shortcode, simply by checking the name of the file.
Overriding Shortcodes Directory
In the WordPress world, term “override” means copy a file from the parent theme and paste it to a child theme with the same directory hierarchy, then editing the copied file. WordPress loads the edited file automatically.
Below, as an example we will override contact form shortcode to change the icons displayed on the front-end of your contact form:
- Parent theme: wp-content > themes > jupiter > components > shortcodes > mk_contact_form > components
- Child theme: wp-content > themes > jupiter-child > components > shortcodes > mk_contact_form > components