WordPress > Parament WordPress theme >
A a child theme for Parament WordPress theme.
These notes are somewhat universal to the child theme process, though likely somewhat out of date.
Get access to your site ∞
First you need to have direct access to your website. I use LFTP for ssh file transfers.
\lftp -p 22 -u USERNAME sftp://WEBSITE
More advanced website content push/pull ∞
I make a script, pull.sh
and a symlink to that same file, called push.sh
.
I make a complete backup of my wp-content folder, although you may wish to be more specific if you don't wish to download all of your images and other attachments.
The script will probably end up somewhere in my github (shell-random).
Begin your child theme ∞
Make a new directory called PARENT_THEME-CHILD_THEME
. For me, it was wp-content/themes/parament-spiralofhope
.
Within that directory you will be creating style.css
as well as any php files you wish.
style.css ∞
This is a minimal example:
/* Theme Name: Parament Simplified Theme URI: https://wordpress.com/theme/parament Description: Child theme for the Parament theme Author: spiralofhope Author URI: https://blog.spiralofhope.com/?p=2666 Template: parament Version: 1.0.0 */ @import url("../parament/style.css");
Other PHP ∞
You can add in arbitrary PHP files in the same directory as your style.php
. If -- before you began your journey with child themes -- you used to edit that theme's content.php
, and you want to have those changes become a part of this new child theme of yours..
- Copy your original theme's php to your new
wp-content/themes/PARENT_THEME-CHILD_THEME
-
Edit that php file freely.
That's it. I actually had to go and look that up to have someone other than the WordPress people tell me the obvious.
It's probably more complex than that, but this is as far as I've been.
Previewing your work ∞
It's bloody important you don't try to upload and activate your experimentation in order to view it!
My theme is called parament-spiralofhope
. I can preview it at:
blog.spiralofhope.com/wp-admin/customize.php?theme=parament-spiralofhope
IMPORTANT: If you use a cache plugin, you must empty your cache before you refresh this theme preview page. For my cache, it is a URL like this:
blog.spiralofhope.com/wp-admin/admin.php?page=w3tc_dashboard&w3tc_flush_all
I ended up disabling my cache entirely to resolve other issues. Consider doing the same, at least for previewing.
Applying your child theme ∞
-
Administration Panels > Appearance > Themes
For me it is:
blog.spiralofhope.com/wp-admin/themes.php
Troubleshooting ∞
- If you use a speed/cache WordPress plugin, then clear its cache before previewing.
- Advanced cache settings can truly fuck everything up. If in doubt, disable that plugin while testing.
-
Control-F5
to force your browser to discard its local cache.
Last updated 2020-01-12 at 00:41:57
Removed the functions.php changes, as that has been replaced by the Code Snippets plugin:
https://blog.spiralofhope.com/?p=36427
https://wordpress.org/plugins/code-snippets/