- This topic has 3 replies, 2 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
January 17, 2023 at 11:08 am #2499273
loixiyo
Hi,
I used the Site Library to create a base website. The thing is that when adding my custom contents I added new CSS, some hooks, some custom CSS etc. I would like to create a child theme and store everything together there. Is there any way to do this and do not forget anything? Or… is there any way to get a whole list of the css, settings etc that the Site Library installed automatically?
Kind regards.
January 17, 2023 at 11:21 am #2499285Ying
StaffCustomer SupportHi there,
You seem to have some misunderstanding about child theme.
If you don’t create custom PHP templates, you do NOT need a child theme.
All the theme settings/elements/CSS will be stored in the parent theme, they will not get lost during theme updates.
But if you really want to use a child theme, here’s the instruction: https://docs.generatepress.com/article/using-child-theme/
January 17, 2023 at 11:37 am #2499299loixiyo
Hi,
Thanks for your response!
Maybe I didn’t explain well:
When you import a site from the Site Library, many things are imported to your WordPress installation: images, css, settings, pages, contents, etc… Then you can delete what you don’t need or add your new stuff.
Well, after that, I created new pages, new contents, added new CSS, some PHP hooks and templates, Javascript etc that I would like to move to a unique please (theme? plugin?) so that it’s all together in a GIT repo.
This is why I thought in a Child Theme. As far as I understand, a child theme allows to create a theme that reuses everything from its parent, except the things you override (post.php, for instance). I think that this is exactly my need, I can create a child theme, reuse almost everything and move my custom code there. Is this correct?
So the question is: what is the best approach to do this? How would you move the code (I can ignore posts and media, this is just contents) to a GIT repo?
I hope I explained better this time.
Regards.
January 17, 2023 at 12:13 pm #2499333Ying
StaffCustomer SupportI can create a child theme, reuse almost everything and move my custom code there. Is this correct?
Correct, if you want to use a custom template like
single.php, a child theme is required.Please be noted that GP has
block element - content templatewhich allows you to create templates using blocks instead of PHP templates.How would you move the code
I attached the link to the instruction which includes how to add a child theme after importing a site library template.
So CSS goes to
style.css, PHP functions go tofunctions.phpand add templates in your child theme folder. -
AuthorPosts
- You must be logged in to reply to this topic.