GithubHelp home page GithubHelp logo

coloredcow / wordpress-init Goto Github PK

View Code? Open in Web Editor NEW
6.0 8.0 5.0 6.5 MB

Boilerplate code for a new WordPress Site

License: GNU General Public License v3.0

PHP 82.28% JavaScript 11.30% CSS 0.40% SCSS 6.03%
wordpress-installation php composer grunt wordpress

wordpress-init's Introduction

Introduction

๐Ÿ‘‹ Welcome to WordPress-init boilerplate.

Prerequisites

Check our prerequisites to get started.

Installation

Use our installation guidelines to set up the project on your local.

WPCS Guide

Use our WPCS guide to set up the WPCS formatter on your local.

wordpress-init's People

Contributors

abhi1203 avatar anirudhap2k avatar dependabot[bot] avatar gauravbhatt19 avatar kuldeep3 avatar mohitgusain avatar p4nk4j avatar pokhiii avatar rathorevaibhav avatar satendra-sr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordpress-init's Issues

Upgrade to latest

  • Update to Wordpress latest release

  • Update Bootstrap to v4.2.1

  • In the theme's functions.php, correct the path of bootstrap.min.js. Correct path is:

get_template_directory_uri().'/dist/js/bootstrap.min.js`
  • Also update the bootstrap.min.js to v4.2.1. Here's the file:
https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js

New features

  1. Add theme support for custom logo
add_action( 'after_setup_theme', 'cc_theme_add_supports' );
function cc_theme_add_supports() {
	add_theme_support( 'custom-logo' );
	add_theme_support( 'align-wide' );
	add_theme_support( 'align-full' );
        add_theme_support( 'post-thumbnails' );
}
  1. Add 404.php and template for coming soon page

Readme content for creating a Virtual Host.

Replace the following lines from wp-config-sample.php

if (WP_ENVIRONMENT == 'Production') {
	define('WP_ROOT', '');
} elseif (WP_ENVIRONMENT == 'Development') {
	define('WP_ROOT', '/put_your_project_name_here/public');
}

Replace the above content by

define('WP_ROOT', '');

Making vhost should be a mandate.

Cannot use WP-CLI inside the project

Is your feature request related to a problem? Please describe.
Cannot use WP-CLI inside the project built using this boilerplate.

Describe the solution you'd like
WP-CLI should be accessible from any directory inside the boilerplate.

Describe alternatives you've considered
Since with this boilerplate, the Wordpress core files are installed inside public/wp/ directory, that needs to be specified with --path option in the all the wp commands.

It would be better if we can have a repository-wide configuration. That will save the user to specify it every time.

Additional context
Add any other context or screenshots about the feature request here.
image

Update the gitignore file.

Description

  • The rule defined for vendor folder is not specified correctly.
  • This lead to a situation where all the vendor folder inside the project are getting ignored.
  • So, some plugins like WPForms, SVG Support etc. also consists of vendor folders, which were not getting updated in the Github repository.
  • Thus, an error was occurring during the activation of these plugins in the WPAdmin dashboard.

Reference

Screenshot 2024-02-28 155147

Error during plugin activation

Screenshot 2024-02-27 160011

Code issues

  1. In public/wp-content/themes/coloredcow/single.php remove PHP ending tag
  2. Fix weird indentation across the project
  3. Add WP coding standards
  4. The plugins that are installed via composer needs to be added to the gitignore
  5. remove public/wp-content/themes/tbxi2020/src/scss/media.scss
  6. Add position utilities like top, bottom on different screens.

Update Installation Guidelines

Describe the task
We are currently not having the pre-requisites and installation guide for this project.

Expected behavior

  • 1. Create a pre-requisites markdown file
  • 2. Create an installation markdown file
  • 3. Both the files should be in docs/ folder
  • 4. Update the main README. It should have links to pre-requisites and an installation guide.

References
Please refer to the README and folder structure of coloredcow-admin/coloredcow repository.

Starting using npm bootstrap-boilerplate

Describe the task
We are using raw files to extend bootstrap. Our effort to maintain these utilities can be reduced by using the npm package

npm install bootstrap-boilerplate

Expected behavior

  1. This package should be in the package.json
  2. Updates to existing utilities files to remove duplicate code in the package and keep only project-specific utilities if needed.

SASS files need code refactoring

As the current SASS installation uses Ruby, whose support seems to be deprecated in 2019 (link for reference). The current SASS installation is supported through Dart using NPM. The problem occurring with current code files is described below:

  • Using SASS-Dart requires some syntax changes in existing boilerplate files for the compilation to be done successfully.
  • Most of these changes are in mathematical calculations of spacers and dimensions.

Add structure for JavaScript assets

What we have

In the current boilerplate, one single JS file is loaded on all the pages (public/wp-content/themes/coloredcow/main.js). This file is compiled from public/wp-content/themes/coloredcow/src/js/main.js.

Issue

With a single JS file, we missed out on the opportunity. There can be page-specific JavaScript like slider may be needed on a single page. I think it makes sense to load it on the pages on which we need it.

Possible solution 1

  1. Have a single JS that contains generic code: public/wp-content/themes/coloredcow/main.js
  2. Have multiple page-specific JS files: page-about.js, page-team
  3. Running grunt will combine main.js with each page's JS file will create minified files for each file.
  4. We will enqueue based on the page's slug

Possible solution 2

  1. The first two steps are the same as above.
  2. Grunt will not combine the page-specific JS file with the main.js and generate the just the minified file.
  3. There will be two files that will be enqueued on each page (hence two requests): main.js and page-*.js

@rathorevaibhav would love to know your thoughts/questions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.