TechnologyWordPress Project Setup Guideline

Foundation for Excellence: The Standard WordPress Enterprise Project Guideline

The WordPress New Setup:-

  1. Always Download the latest version of WordPress from WordPress.org and use it. (Link-https://wordpress.org/download/)
  2. If you are working on a Staging server like a Beta server then make it a project folder inside the WordPress Folder.

E.g:- For xyzbeta server- http://xyzbeta.com/wordpress/projectname

E.g:- For Local server- xampp/htdocs/wordpress/projectname

  1. Make a new Database and the database name should start with the “wp_” prefix. E.g :- wp_projectname
  2. Set Username as “wpadmin” and set Strong Password like “3g%rQ14$AC^Y”.
  3. If the client doesn’t give an email address then use your testing Email address.
  4. If any updates are required for the theme, plugins of WordPress then first update it and then start development.
  5. If Clients provide a purchased WordPress Theme then it’s good no need to change anything. but if we use any default WordPress Theme then we need to customize it.

Select one of themes from default WordPress Themes and remove remaining all themes.

  • Change theme name of Selected theme to “devtheme”.
  • E.g: “Twenty Twenty One to Dev Theme”
  • “twentytwentyone to devtheme”
  • “Twenty_Twnety_One” to Dev_Theme”
  • Change screenshot.png image with your customized theme screenshot.png in the theme folder.
DEVTHEME

CSS and JS

  1. Check out the wp_enqueue_style() function for adding custom CSS files into WordPress.

Reference Link

https://developer.wordpress.org/reference/functions/wp_enqueue_style/

  1. Where to place a custom.css file inside the theme folder?

wordpress/projectname/wp- content/themes/themename/assets/css/custom.css

  1. Open a function.php file and add wp_enqueue_style() function to call custom.css files into WordPress.

Path of function file: wordpress/projectname/wp-content/themes/themename/functions.php
E.g:- wp_enqueue_style( ‘custom-css-style’, get_template_directory_uri().’/assets/css/custom.css’, array(), ‘custom_css’ );

  1. Check out the wp_enqueue_script() function for adding custom JS files into wordpress.

Reference Link
https://developer.wordpress.org/reference/functions/wp_enqueue_script/

  1. Where to place a custom.js file inside the theme folder?

wordpress/projectname/wp-content/themes/themename/assets/js/custom.js

  1. Open a function.php file and add wp_enqueue_script() function to call custom.js files into WordPress.

Path of function file:
wordpress/projectname/wp-content/themes/themename/functions.php

E.g:- wp_enqueue_script( ‘custom-js’, get_template_directory_uri() . ‘/assets/js/custom.js’, array(), ‘custom_js’ );

Create Widgets:-

  1. Check out the register_sidebar() function for how to create widgets.

https://developer.wordpress.org/reference/functions/register_sidebar/

  1. Open a function.php file and add register_sidebar() function to create widgets.

Path of function file:
wordpress/projectname/wp-content/themes/themename/functions.php

Reference Link:
https://developer.wordpress.org/reference/functions/register_sidebar/

Create Child Theme

  1. Create a child theme

Reference Link:
https://developer.wordpress.org/themes/advanced-topics/child-themes/

Create Child theme folder inside the active theme
wordpress/projectname/wp-content/themes

Create Custom Template

  1. Create a custom template

Reference Link:
https://developer.wordpress.org/themes/template-files-section/page-template-files/

Create your template file (your_template_name.php) inside the theme folder wordpress/projectname/wp-content/themes/themename

Copy code from page.php file and paste it into your_template_name.php file.

Path of page.php file wordpress/projectname/wp-content/themes/themename/page.php
Then add a Template code on top of the your_template_name.php file.

E.g:- Template Name : Full_Width_Page

Note: Don’t leave space between words of your Template Name

General Rules to Follow

  1. Maintain theme structure in all files and templates.
  1. Remove unused plugins, images.
  2. Don’t use outdated plugins, use only the latest plugin which is compatible with your version of WordPress.
  1. Change all default fonts from style.css and replace them with PSD / XD / FIGMA fonts or project-related fonts.
  2. Always check all forms working properly or not like: email sending, validation, email format, etc.
  3. Always Create code Using WordPress Standard Like WordPress Hooks, Filters, Functions.
  4. Before Project submission checks properly and remove unnecessary code, commented code, and commented CSS.
  5. When you start work on any existing project, get backup of that project before starting working or customization.
  6. WooCommerce :
  • Maintain structure like theme structure.
  • Do not make any changes in plugins files.
  • Customized WooCommerce files in your theme folder.
  • Follow the below steps :
    • Create a WooCommerce folder in your theme folder.
    • Copy required files of the “templates” folder from the WooCommerce plugin and paste them on the WooCommerce folder in your theme folder.
    • Now you can customize and update files in the WooCommerce folder of your theme.
  1. Security :
  • When Project Is Completed Then Add Wordfence Plugin For Security.
  • Follow Below Steps :
    • Scan The Whole Site Using Wordfence Plugin.
    • Enable brute force protection

Follow us

LinkedIn | FacebookInstagram | Twitter

Leave a Reply