I have updated my WordPress version. The style of the css is modified. I have a backup version. Should I take the oldest file for plugins and theme in order to resolve that issue?
you should have a child theme and put your custom css in the css-file from your child-theme.
Your child-theme would not touch from any update and your custom code is save
Taken from the WordPress Codex:
WARNING: The upgrade process will affect all files and folders included in the main WordPress installation. This includes all the core files used to run WordPress. If you have made any modifications to those files, your changes will be lost.
When you do any theme changes you should always put your changes in either a custom theme you have made yourself (so only you update it), or if you're using someone else's theme, create a child theme.
More information about child themes can be found here:
A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme. Child themes are the recommended way of modifying an existing theme.
As for plugins, they don't work in the same way so you'll need to make sure that any plugins you change are your own otherwise you'll lose the changes when you update them.
Lastly, you can also use the WordPress Customiser (Appearance > Customize in the dashboard) if you don't want a child theme but want to insert custom CSS. That allows you to edit CSS safely within the dashboard and keep your changes safe even when you update things.
Related
There are some plugins that I can override in my child theme (e.g. woocommerce, BuddyPress, bbpress, etc). Usually creating a folder named the same as the plugin in the child theme root and making changes there. However, that doesn't always work for ANY plugin. I'd rather not make any structural changes in the plugin itself since it will be all gone on a plugin update. But I made a copy of the plugin in the child theme and it didn't do anything. How can I do this so that I can still get all the functionality I need from the main plugin and still have my alterations prevail?
I'm new on wordpress and I have readed about childs themes.
My question is, Is that neccessary that I create my self child theme or can I use other theme child created ? that's to say, if I use a child theme created for other person, that theme will not change that I do it?
The way a child theme works is that it overrides the default settings of your chosen theme. So you only have to allow for the parts of the theme that you want to make your own.
As long as a child theme created for someone else is based on YOUR main theme, then you could use someone else's child theme.
For example, if someone has a child theme that works for Wordpress 2017, you can upload and modify that for your own use, for example to change the css or create your own header and footer files (usually named header.php and footer.php). These are the things I do most often.
If you don't already have a child theme for your chosen theme, though, it is best that you create one yourself. It is quite straightforward, all you have to do as a minimum is create a child theme folder with a style.css in the correct format and a functions.php file in the same folder using these instructions https://codex.wordpress.org/Child_Themes
If all you want to do is play with color and fonts, you might find it easiest to just use the Wordpress Theme Customizer. These changes will be maintained during upgrades in a custom.css file (or equivalent) so you shouldn't need a child theme.
Hope this helps
I am using wordpress! I have certain pluginsthat i use that I personally modified and made changes to.
I have even made edits to css files as well
I heard if you update the files , (when a update becomes available) the updates will overwrite the changes you have made
how can I avoid this?
**The theme I am using is not a child theme i believe
When updating WordPress, no theme or plugin files (except for the default WordPress themes maybe) will be overwritten.
When updating a plugin, plugin files will be overwritten indeed. A possible solution is – when that plugin is using hooks – to unhook and than re-hook them with your own copy of that function in the functions.php file of your theme. Furthermore, there is not much you can do.
With themes, it is best to create child-themes.
I am using a WordPress theme in a site. I want to edit the bottom of the page, replacing the WordPress default message and replace it with a custom message. The problem is, the change I want to make should be independent of the theme. I can change that editing footer.php using admin panel. Problem is, I do not want the changes to be reverted as soon as I change the theme. Can anyone suggest how to achieve that? Besides I want to remove the WordPress logo, too.
This isn't the way wordpress works I am afraid.
Anything that is tied to the database (posts, pages etc etc) will remain from theme to theme, but any changes you make to the theme files directly (editing default footer text) are tied to not just that theme, but those specific files. If you change the theme, or update the theme to a new version, your changes will be lost.
You are editing a file, and that file will no longer be in use when you switch theme.
You could use a plugin to create an overlay layer at the bottom of the page but this would be a fairly nasty solution and would be liable to appear differently when you change the theme.
Alternately, a plugin could be used to inject some javascript that modifies the footer but again, would depend on the theme as to what classes/IDs you'd be wanting to modify.
Basically this isn't something that's done!
I built a Wordpress child theme based on Thematic framework and edited some template files. When I upgraded to a new version of Thematic all changes to my template files were lost.
I guess it makes sense but that makes me a little disappointed in the child theme concept...
So if I understand correctly, there's no way to edit template files of Thematic (or any other WP theme framework?) and then upgrade easily and keep the changes? The way to modify a Thematic child theme is with styles and hooks, but changing template files is a no-no because all changes will be lost with upgrade?
By child theme, i'm assuming you just made some changes to that Thematic theme but for a specific blog, in which case, yes, your changes would of been over written on upgrade.
To avoid this, create a new theme folder on your sever and copy all the files over to that new theme. Once the files are copied, go into your stylesheet, and modify the comments in the header of the file. This is where you can rename your theme to say something like Thematic Theme Customized or you can rename it to whatever you want.
Once these two steps are complete, you should be good to make any modifications without fear of your data being erased on site upgrade.
Please note, that by going this route, WordPress doesn't know there's a new theme that it needs to upgrade, so if the Thematic theme has a system upgrade it needs to update, you'll need to copy that update over to your newly modified theme.
Hope this helps
Make sure you copy the childtheme out the thematic theme dir into the theme dir and edit the childtheme functions.php. Otherwise if you upgrade the theme changes will be lost.