Help With Child Themes

SuperAgora

Member
Can someone from our group possibly offer some help on properly creating a Child Theme from the original Davinci theme please?

Which files exactly are needed to be copied over in the /davinci-child/ theme directory?
The instructions here (https://codex.wordpress.org/Child_Themes) are either incomplete or not pertaining 100% to our situation.

So far I have created the sub-directory /davinci-child/ and I have placed the style.css and functions.php file as described in WordPress's codex, but when I activate the child theme (or do a Live Preview) I get the original images from the initial davinci theme.

Any help would be appreciated.
 

SuperAgora

Member
Dear developers,

Even though you recommend using the child theme approach (as per WordPress's codex) to modify styles yet when I try to create a child-theme from your template I get the following error:
===================================================
This theme (Davinci) loads the parent theme's style.css file outside the wp_styles queue.
This is common with older themes but requires the use of @import, which is no longer recommended.
====================================================
Is there any way you can please fix this issue with your templates?

Thank you
 

Direct Webstore

Well-Known Member
There are free plugins that simplify the creation of Child Themes. I tried having a child theme for DaVinci a while ago but did not like it. There was a 1-2 second delay before it kicked in. The main "mother" theme displays at first for 1-2 seconds before the child theme takes over. I doubt the Child Theme Plugin is the problem ... it just creates the theme ... not control it. After creating the theme you can even uninstall the plugin and still use the theme. I tried 3 different plugins ... the themes all had the same behavior.

But give it a try yourself ... https://www.google.com.au/search?q=...annel=rcs&gws_rd=cr&ei=ODzXWPyaB8iw8wWK75DgDg

I went back to putting my custom CSS in the box provided in the "Customization/Head" section ... and keeping a copy of the three theme files I modified. (header.php, home.php, footer.php) So far ... with each theme update those files have not changed ... and I just upload my saved/edited copies. If one of those files ever changes ... I'll just edit the new file.

How do I know if there has been no changes in the files with a theme update? I have copies of the original un-edited files and I "Compare" the with the new ones with the free "Notepad++" https://www.itsupportguides.com/kno.../how-to-compare-two-text-files-using-notepad/

It sounds like a pain in the arse ... but it really only takes 5 minutes with each theme update.
 
Last edited:

SuperAgora

Member

Thank you for taking the time to reply to this thread.

I did try a few child theme creator plugins, but they yielded the exact same results as the manual method described in the codex online.

The only difference was that I had no 2 second delay between loading the master and the child theme, because even though the child-theme styles were loading properly I could not see any difference in the output.

Anyway, I'll need to investigate this further and get a better understating on the subject of child theme creation.

Your approach may not be fully automated, but at least it's a working approach and you have peace of mind that you don't stand in losing all the style changes you've made so far just because of a template update.

So in my mind you've setup a bulletproof method.

 

Direct Webstore

Well-Known Member
I get the original images from the initial davinci theme.

I just remembered from when I was looking into child themes ... I'm sure I read something about having to edit the paths to images in some file ... Google it. I forget the details now. :)

EDIT: ... and I just remembered that was another reason I gave up on the child themes. I do have a few customised images in the "img/main" directory ... so I just upload the whole thing and overwrite the stock images that are replaced with a theme update.
 

Direct Webstore

Well-Known Member
Finally I found a solution to all my CSS styling problems (when using AliDropship's templates).

https://wordpress.org/plugins/wp-add-custom-css/

OR
https://wordpress.org/plugins/simple-custom-css/

It works just great and it's free!

Thanks for all your help Mark.

Yes ... I used "Custom CSS" (but copied it all into the Header / CSS Box later) + Keep a copy of 3 theme files + Keep a copy of 1 image folder. = 5 minutes work with each theme update. :)

EDIT: I also keep a copy of the custom CSS in a text file as a backup.
 

robert syputa

New Member
If you wish to use an Alidropship authored theme and do not want any updates of the plugin to impact your custom CSS or other customization work, one way to work around the over-writing is:

1) Use a ftp, SSH, or control panel file browser.
2) Go to the site's wordpress folder. For Linux Centos and other servers this is usually found at home/mydomain/public_html or the additional folder /wordpress (check your web host for location if you don't know it).
3) Go to the folder under the domain root folder per 2) named wp_content/themes and find the theme folder that you wish to use. Example folder is davinci.
4) Select that folder in the file browser and execute the command to rename it to something like davincis (all small caps).
5) Go to the renamed theme folder, and edit the file style.css: at the top of the file you will see "Theme Name: Davinci" without the quotes. Change that line to something like Theme Name: Davincis Child and save the file.

The next time you access the administration of Wordpress it should show the installed theme as Davincis Child.
If you want to have the original theme back, you must upload install it to Wordpress.

Alidropship uses Bootstrap (currently v3.3.4) to generate their themes and they select to minify the css and other files. This also uses a workflow that is no longer accepted by Wordpress which is why there is a mess with editing custom CSS. If they changed to use the current standard Wordpress file and content syntax this would stop being a problem.

"We are all idiots, just some of us don't admit it"
 

robert syputa

New Member
Yes, the use of a child theme generator plugin was mentioned previously. However, my post is directed at the situation in which the parent theme or its external dependencies, such as CSS files that do not fit into the normal flow and cannot be addressed using a child-theme generator fix is either modified by updated/overwritten.

I personally have been trying both the canned alidropship plugin and the woocommerce version plugin. The problem I find with the alidropship canned version is that it uses non-standard headers and other parts that do not allow use of some WordPress plugins such as page visual editors.
 

Direct Webstore

Well-Known Member
Setting up a normal child theme is quite simple. It only requires the functions.php and style.css and any other theme files you want to modify. I'll attach a basic Davinci Child theme for anyone who needs it. Just install and activate it like any other theme (Have the original Davinci theme installed as well) Just add your CSS changes to the style.css file and add any other theme files from Davinci that you want to modify. Simple. :)

I have been using a Davinci Child theme for months with heavily modified header.php, footer.php, front-page.php, social-b.php and blog section files ... with no problems at all. The attached child theme is exactly the same one I use ... minus css modifications and the extra modified theme files mentioned above.
 

Attachments

  • davinci-child.zip
    790 bytes · Views: 25
Last edited:

robert syputa

New Member
Thanks for the upload of the Davinci child theme. You have answered the objective of the topic heading. This improves upon the theme.
Some elements, including the entire header area, including the menu and images, cannot be edited or extended using some Wordpress plugins.

To deviate to the broader issue of not being able to use many of Wordpress plugins, such as Elementor, Visual Composer or other wysiwyg drag-and-drop and modular components editors does not change. With the alidropship canned plugin users are limited to plugins that do not need to use standardized Wordpress theme conventions. The alidropship canned version does not comply with current versions of Wordpress and that cannot be fixed unless the entire theme is changed to replace the proprietary parts with Wordpress standardized parts. It just won't work by modifying CSS and other files because it will not have the hooks to the alidropchip plugin script. Users cannot change that because parts of the canned aliplugin are encrypted and minified and the theme uses out of standard process flows.

The reason I posted on this here is because many seem to be making requests on this board for use that is better met by using the woocommerce version of the plugin. While that does not have several of the features of the canned version, thus must be added using additional Wordpress plugins, such as the abandoned cart plugin alidropship recently made available, it is a preferable way to go for those who want more flexibility in their site designs.
 
Last edited:

Direct Webstore

Well-Known Member
There are heaps of plugins that use shortcodes that you can use by inserting them into child theme files. That's the whole point of using child themes. You just have to be adapable and imaginative. I've been able to make quite extensive modifications and use a variety of plugins. But if anyone has a problem with that ... use Woo.
 

robert syputa

New Member
Yes, that works for many sites. The preferred way to build a high traffic or long-term maintainable site is not to use shortcodes except as cannot be avoided. Use of shortcodes is not easily reversible: if a shortcode plugin is removed, the shortcode remains in the files and shows up as broken gibberish or, worse, a broken website. If you decide to use a different set of shortcodes for a function unless it uses the exact same library functions, I have to admit some do but many people will not know that, then you must replace the shortcodes for in order to replicate the functionality and probably will need to change the parameters.

On the other hand, the use of Elementor or Visual Composer will strip out the code added by the plugin and leave reasonably clean/original files/HTML code and CSS. (see write-ups on this subject via web search).

The point is not to say that one plugin or way of building a website/shop is the 'correct way'. However, there are trade-offs that some people will want to consider. Depending on their goals for the site, the site's response times/scores, the server platform they are using or may use in the future/migrate to, the choice between using the canned version of the plugin and the Woocommerce version have a significantly broader set of implications.

I think you and I understand this but it has been worthwhile having the conversation to expose these things to the community IMO.
 
Last edited:

robert syputa

New Member
BTW, If anyone is looking to have their own high-performance VPN/VPS server and is capable of taking on the self-administration, I have a extra one available at this time. It is more expensive way to go than a shared-host server and requires knowledge or learning of Virtualmin/Webmin, but it is highly extensible to multiple physical servers to build your own 'cloud platform' capable of millions of hits.
 

Direct Webstore

Well-Known Member
if a shortcode plugin is removed, the shortcode remains in the files and shows up as broken gibberish or, worse, a broken website.
Rubbish. It takes a couple of minutes to take care of.
The preferred way to build a high traffic or long-term maintainable site is not to use shortcodes
Sorry. I can't see that in the "rulebook" anywhere. LOL
If you decide to use a different set of shortcodes for a function unless it uses the exact same library functions, I have to admit some do but many people will not know that,
These "people" would have put the original shortcode there in the first place. Of course they'd "know that". :)
The point is not to say that one plugin or way of building a website/shop is the 'correct way'.
That's exactly what you've been saying. It seems like just a lot of "noise". Just use the Woo plugin ... for God's sake.

The original themes are designed for newbies. Just accept that and move on. (Or modify to your hearts content if you wish) :)
 
Top