PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 15, 2022

[FIXED] How can I import my custom CSS and HTML into Wordpress? And how do I prevent updates from erasing my code?

 July 15, 2022     css, html, php, web-deployment, wordpress     No comments   

Issue

Summary: Question 1. How do I import css and html into Wordpress? Question 2. How do I protect it from being erased by a Wordpress theme update? 3. Is there an alternative that allows me to publish my code the way it is without a CMS, and if so what is it?

I built a website layout in my text editor using just HTML and CSS for a client. Her website is under 10 pages. Now I need to import this code into her CMS/website builder, Wordpress. How do I do this while protecting it from being deleted by Wordpress theme updates?


Solution

How to get code in wordpress:

In your theme files, there are the header.php, page.php, single.php, archive.php, footer.php, which are parts of your wordpress site. If you past your code in here, the pages where the theme files are used (for example the header and footer is used everywhere in the frontend in most themes), will include your code.

How to prevent being overwritten:

You can create a child theme of your theme. This way, it uses the files from the parent theme, but if you put a file with the same name in the folder of the activated child theme, it uses this instead of the file of the parent theme. This way your changes will not be overwritten, when there is an update being installed at the parent theme. This may be a good tutorial https://premium.wpmudev.org/blog/how-to-create-wordpress-child-theme/

Publish your code in the internet

You can use a webhost (there are thousends) or a repository. There are also free alternatives. Webhosting should bring you answers.



Answered By - rank
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing