Upload
prva-ceta
View
218
Download
0
Embed Size (px)
Citation preview
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 1/9
WP Installation and Settings
CONTENTS
Starter Settings ........................................................................................................ 2
Local Settings ....................................................................................................... 2
Hosting Settings ................................................................................................... 2
Virtual Host Settings ................................................................................................ 3
DW setup ................................................................................................................. 4
WP setup .................................................................................................................. 5
Theme Development ............................................................................................... 7
Creating Child Theme ........................................................................................... 7
Deployment ............................................................................................................. 9
DB handling .......................................................................................................... 9
File Handling ........................................................................................................ 9
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 2/9
STARTERSETTINGS|
2
STARTER SETTINGS
LOCAL SETTINGS
☐ Create folder under C:/wamp/www (eg. mysite.com)
1. Create another extra folder in the root named dev to store materials
(images, PSDs, credentials etc.) during development phase. This directory
shouldn't be deployed.
☐ Create DB via phpMyAdmin
1.
User Add User
a.
user = dbname1, host : "localhost", password: something clever b.
Create database with same name and grant all privileges
c.
Global privileges Check All
HOSTING SETTINGS
☐ Add Domain (and get DNS).
☐ Create DB (and document hostname and credentials).
1 No uppercase, dots, dashes and other special charachters in the user/DB name.
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 3/9
VIRTUALHOSTSETTINGS|
3
VIRTUAL HOST SETTINGS
☐ Update C:\Windows\System32\drivers\etc\hosts
o 127.0.0.1 mydomain.com
☐ Update C:\wamp\bin\apache\apache2.4.92\conf\extra\httpd-vhosts.conf 3
o To define virtual host and enable WP url rewritings
*Make sure to define virtual host without www prefix since you'll need it to see
actual, live, site via browser, on that machine.
☐ Restart all Wamp services
2. This may vary depends on your WAMP installation version so make sure you check it with click on the Wamp icon
in the Notification Area and then Apache Version
3. Nifty tutorial on setting virtual host on Wamp:
https://www.kristengrote.com/blog/articles/how-to-set-up-virtual-hosts-using-wamp
<VirtualHost *:80>
DocumentRoot "C:\Users\xxx\xxx\www\mydomain.com"
ServerName mydomain.com
ServerAlias mydomain.com
<Directory "C:\Users\xxx\xxx\www\ mydomain.com ">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
RewriteEngine On
RewriteBase /
RewriteRule ̂ index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</Directory>
</VirtualHost>
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 4/9
DW
SETUP|
4
DW SETUP
☐ Create new site in Dreamweaver
1.
Site New site
2. Site Name: Whatever you find appropriate, usually same as the project
name.
Local Site Folder: Point it to the inside of your site folder (e.g.
C:\wamp\www\mydomain.com\ ).
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 5/9
WPSETUP|
5
WP SETUP
☐ Grab zipped WP installation from https://wordpress.org/
☐ Extract content of wordpress-X.X.X.zip/wordpress folder into mydomain.com
folder so the wp-admin, wp-content and other folders and files resides in the very
root.
☐ Edit wp-config-sample.php and save it as wp-config.php4
1. Update DB_NAME, DB_USER, DB_PASSWORD, DB_HOST
2.
Update Authentication Unique Keys and Salts from
https://api.wordpress.org/secret-key/1.1/salt/
3.
Remove wordpress-X.X.X.zip from the root of the site
☐ Open your site folder via browser, according data defined in Virtual Host
Settings section (e.g. http:// mydomain.com).
1. Finish WP installation by choosing language and defining your credentials
after.
a. Use actual data since this whole DB will be uploaded to the server
later, so you don't have to temper with it and change your
credentials there.b. Avoid using "admin" as a username and choose some decent,
secured password.
4. Save this file as wp-config-web.php as well, for the future usage on the webserver and update your live site
credentials in it . It will be uploaded to the webserver later and renamed to wp-config.php (on the live server).
In this way you can develop and test locally (using wamp) and keep web project independent.
Since local DB credentials and web server's DB credentials won't be the same, you'll have 2 files: 1 for the
connection with local DB (with its own credentials) and another for the live site with actual DB user, password,
hostname…
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 6/9
WPSETUP|
6
☐ Log In to your WP site using credentials defined in previous step.
☐ Create Home Page: Pages Add new Title: e.g. Home Publish.
☐ Create Blog Page: Pages Add new Title: e.g. News Publish.
☐ Update Settings Reading:
1.
Front page displays: A static page
a.
Front page: Select "Home" page you defined few steps before
b.
Posts page: Select "News" page you defined few steps before
☐ Update Settings Permalinks
1. Custom Structure: /%category%/%postname%/
☐ Update Settings Discussion:
1.
Uncheck: Allow people to post comments on new articles.
2. Check: Users must be registered and logged in to comment.
3. Check: Comment must be manually approved.
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 7/9
THEMEDEVELOPMENT|
7
THEME DEVELOPMENT
☐ Create your theme folder under /wp-content/themes/
1.
Lowercase, basic latin charachters, no dashes, spaces etc.
☐ Create style.css in it.
CREATING CHILD THEME
Creating child theme is a great way to inherit complete logic and functionality
from another "parent" theme but make custom changes to styles, functions or
layouts without need to create and define all necessary files (for which WP will
look for).
☐ Place following code at the top of your theme style.css
/*
Theme Name: My Brand New Theme
Theme URI: http://example.com/twenty-fifteen-child/
Description: Twenty Fifteen Child Theme
Author: John Doe
Author URI: http://example.com
Template: twentyfifteen
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.htmlTags: light, dark, two-columns, right-sidebar, responsive-layout,
accessibility-ready
Text Domain: my-brand-new-theme
*/
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 8/9
THEMEDEVELOPMENT|
8
☐Create functions.php in the root of your theme folder.
Place following code in your functions.php
Styles from this document will override Twenty Fifteen Theme's styles, although it
will be load as well.
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array('parent-style')
);
}
?>
7/23/2019 WP Instalation and Settings
http://slidepdf.com/reader/full/wp-instalation-and-settings 9/9
DEPLOYMENT|
9
DEPLOYMENT
DB HANDLING
Export local DB using local phpMyAdmin
1. Go to DB and pick EXPORT tab.
2. Format: SQL.
3. Store it under dev folder (e.g. C:\wamp\www\mydomain.com\dev).
4.
Create a copy of .sql file and give it a web_ prefix (e.g web_mydomain.sql).
Update .sql file for DB record to match live URLs and yet you can see both local
and live sites in your browsers5.
1.
Simple use Notepad to open .sql file
2.
Use CTRL+H to invoke Replace dialog
a.
Search for http://mydomain.com and
b. Replace it with http://www.mydomain.com
Import your new web_ *.sql file in the DB via web phpMyAdmin.
FILE HANDLING
Upload content of your project to the server
1. Except wp-config.php since it contains local DB configuration.
2.
On the server: Rename wp-config-web.php to wp-config.php
5 Since you defined virtual host as http://mydomain.com you won't be able to see live web content on that domain
because wamp will intercept and redirect all requests for that domain to the local directory that you pointed that
VH to. Simple solution is to add www prefix to your call and you'll see actual web content.