I want my shortcodes and JS libraries to remain in place no matter if the theme updates, wordpress updates, or I change themes completely.
Normally the suitable place for such in WP would be a plugin or as variation of must use plugin.
More elaborate site might also use some other (generic PHP) methods, such as Composer packages.
Is there any way to protect/maintain changes to a theme’s header.php as well?
There is no way to “protect” a change to a template file. This should definitely be handled by a child theme — copy modified template to it and it will be picked over parent template.
If theme offers sufficient hooks it might be possible to inject logic with code, rather than making template changes. It depends.
Related Posts:
- Removing Shortcodes from Child Theme
- Theme doesn’t support shortcodes
- how to stop a gallery slideshow
- div having different appearances in different themes
- Overwrite functions.php of a theme – What if the theme is updated?
- Where can I download WordPress themes from? [closed]
- Where can I learn to create my own theme?
- How do I turn off self-closing tags for markup in WordPress (for HTML5, or HTML4, for example)?
- How to move the sidebar in TwentyFifteen to the right?
- How can I version the main CSS file?
- Dash or underscore in theme folder name?
- Do Child-Themes automatically load the Translation from the Parent-Theme?
- Using Multiple Themes in a Single WordPress Site?
- How to override the “inc” folder (or any folder) in a theme using child theme?
- Pre-populating the Page/Post Content Editor with HTML Snippets?
- How can I use WordPress as a job board ? (but free)
- Using WordPress as piecemeal in existing site?
- I’m trying to add an image in my CSS
- How to create a theme option-menu page to save user values
- How to put a banner ad between post 1 and post 2 on homepage only
- Changing the title of post with code
- Extra themes – ok or bad?
- WordPress AJAX in header.php
- Add transparency to wordpress color picker?
- Can’t Install Child Theme “The parent theme is missing. Please install the “Default” parent theme.”
- Why is WordPress asking me to update my new (virtually blank) theme?
- During theme installation theme upload failed
- How to find a file in WordPress themes [closed]
- Change title slug or separator in WordPress
- How to configure PoEdit to pick up translation string?
- how to remove padding from left and right side? [closed]
- wp theme.. Could not create directory
- Free themes for commercial use
- Should a child theme share the same theme options row as the parent, or should it have it’s own options row?
- Installed theme uses get_template_directory, breaks WordPress on Windows
- How to conditionally display widgetized areas in theme customizer?
- How prevent someone from opening my theme directory
- Switching a Site to WordPress and Leaving It Live Until Ready
- Angular integration with homepage
- Edited Child Theme’s “header.php” but it doesn’t appear to change the file
- WordPress redwaves-lite theme Comments Quote remove [closed]
- Troubles with Walker_Nav_Menu and closing
- Different logo on homepage
- Translation not working after editing plugin template
- How to apply different themes with custom design in one site?
- Selected template is not respected for home page in WordPress
- How to restore file or theme?
- A /proc folder in wp-content?
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- Problem Installing a Premium Theme– File Permission Issue on a Mac, Local Machine? [closed]
- Child theme’s stylesheet cannot load [closed]
- Trying to uninstall a theme, but it’s hijacking my home page
- Basic Theme for a Static Corporate Website?
- SOLVED Custom Add rewrite rule and Get string
- How to add some php code in header.php using plugin
- WordPress Theme and Plugin Name extraction
- Section Background Images?
- Theme update deleted my custom page
- Homepage showing a simple listing of title, featured image, then posted on
- Permissions error
- Alternative to Back End Dashboard?
- Setting a new default template for the creation of a page
- Adding a template in WPTouch
- Event Organiser breaks the theme [closed]
- one page wordpress theme
- How to remove the tripadvisor logo from the wordpress theme?
- Can’t see themes for Multi-site wildcard subdomain
- WP Nanoplex 1.0.3 malfunction
- Cannot change WordPress site title on a staged site
- Transclude/Import one wordpress page to another
- Understanding the child / parent theme relationship
- i want remove class from post links
- share wrordpress data between two shared hosts using REST API
- Video not showing on smaller resolutions
- Avoiding do_shortcode() loops
- I want to remove part of a header
- Moving website from localhost to existing website without altering existing live theme
- WordPress theme works on linux servers but white screen after move to Xampp
- Own WordPress theme with custom AFCs > Export all to theme format?
- Default and warning messages & no login
- Theme customizer hiding sections
- How do I change theme demo [duplicate]
- Customized wordpress theme locally put on someones WordPress account
- Uploaded WordPress theme not finding pages and css
- Media previews on posts
- Updating theme resets theme options settings and widgets
- load language file
- Are immediately-called actions not usable in themes?
- How to add different link on each Post [closed]
- EM in CSS different size on wordpress then elsewhere [closed]
- Add Media + Quick Edit buttons not working
- WordPress Theme Problem
- wordpress not able to open theme-editor.php
- How to insert a column (part of theme) in the middle of the content body?
- Localization issue. Codestyling localization, incompatible theme
- A custom jquery posts slideshow?
- Help with Divi logo not appearing for 10s
- How to clone a theme template from within WordPress? [closed]
- Disabling Full Site Editor (FSE)
- get_post_meta() doesn’t allow email