This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############### | |
initialization | |
############### | |
create folder | |
git init | |
get git info from github | |
create files | |
create gitignore | |
commit files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.screen-reader-text { | |
clip: rect(1px, 1px, 1px, 1px); | |
position: absolute !important; | |
height: 1px; | |
width: 1px; | |
overflow: hidden; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// LINKED NODES | |
var gulp = require('gulp'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
browserSync = require('browser-sync').create(), | |
eslint = require("gulp-eslint"), | |
sass = require('gulp-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), | |
prettyError = require('gulp-prettyerror'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set up a new project with Webpack: | |
Create a new folder for your project: | |
Remember to run npm init in your project’s root directory. | |
Remember to create a .gitignore file and add node_modules at the top | |
Create the following folders within: | |
src | |
build | |
Create the following files: | |
index.html (in project root) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$my_var = false; | |
if ( isset( $my_var ) ) { | |
echo "It's set!"; | |
} else { | |
echo "It's not set."; | |
} | |
The empty() function checks if the variable is an empty string, 0, NULL, or false. | |
$my_var = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You may often see loops written in a slightly different way from what we've seen so far: | |
if ( $color == 'blue' ) { | |
echo '<p>The color is blue.</p>'; | |
} elseif ( $color == 'red' ) { | |
echo '<p>The color is red.</p>'; | |
} else { | |
echo '<p>The color is not blue or red.</p>'; | |
} | |
<?php if ( $color == 'blue' ) :?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To convert array items into a comma-separated string, use the implode() function: | |
$skills = array( 'html', 'css', 'js', 'php' ); | |
$comma_separated = implode(',', $array); | |
echo $comma_separated; // output: html,css,js,php | |
You can also convert a string to an array using the explode() function: | |
$skills = 'html css js php'; | |
$skills_array = explode( ' ', $skills ); | |
print_r( $skills_array ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We can also install WP locally using MAMP: | |
Download WordPress | |
Unzip your download and move it to your htdocs folder (rename the unzipped folder if you like) | |
Go to phpMyAdmin (via MAMP) and create a new database | |
Rename wp-config-sample.php to wp-config.php and fill in your database name and MAMP credentials | |
Go to http://localhost:8888/YOUR-FOLDER/wp-admin/install.php and complete your install | |
name folder and name database same thing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To do that, go to the MAMP WebStart page and click on the Tools > phpMyAdmin in the menu. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: RED Starter Theme | |
Theme URI: http://underscores.me/ | |
Author: RED Academy | |
Author URI: http://www.redacademy.com/ | |
Description: A WordPress start theme for RED Academy students. | |
Version: 1.0.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
*/ |