perpetuum mobile
18. 08. 2014. ttt cms * ttt linux * ttt ubuntu * ttt wordpress

Installing Wordpress on Ubuntu 14.04

setting up the database

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost;
FLUSH PRIVILEGES;
exit;

setting up wordpress

cd ~
wget http://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
sudo mv wordpress /var/www/html/
cd /var/www/html/wordpress
cp wp-config-sample.php wp-config.php
gksu gedit wp-config.php #db details
mkdir /var/www/html/wordpress/wp-content/uploads
sudo chown -R $USER:www-data /var/www/html/wordpress

setting up the server

# server name used in the example: blog
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/blog.conf
gksu gedit /etc/apache2/sites-available/blog.conf

sudo a2ensite blog
sudo service apache2 restart

gksudo gedit /etc/hosts
# 127.0.0.1 blog

installing the script

sudo apt-get update
sudo apt-get install php5-gd libssh2-php

# running the install script from http://blog/

adding plugins

# downloading and extracting the plugin
sudo mv EXTRACTED_PLUGIN_DIRECTORY /var/www/html/wordpress/wp-content/plugins/
sudo chown -R $USER:www-data /var/www/html/wordpress/wp-content/plugins/

unicode

In wordpress/wp_config.php:

define('DB_CHARSET', 'utf8');
define('DB_COLLATE', 'utf8_unicode_ci');

updating wordpress and managing plugins from localhost

In wp-config.php:

define('FS_METHOD', 'direct');

Creating a child theme

  • create a subdirectory in wp-content/themes
  • In the child theme directory, create a file called style.css:
/*
 Theme Name:   My New Child Theme
 Template:     twentyfourteen
 Theme URI:    http://example.com/some-dir/
 Description:  My New Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Version:      1.0.0
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  my-new-child-theme
*/

@import url("../twentyfourteen/style.css");

/* =Theme customization starts here
-------------------------------------------------------------- */
  • only theme name and template are mandatory; template name corresponds to the parent theme
  • @import url line should contain path to the parent theme’s style.css
  • activate the child theme in wp-admin
  • override any file in the parent theme by including a file of the same name in the child theme directory
  • add empty php file functions.php to the child theme directory; that file will be loaded in addition to the parent’s functions.php

 Overriding plugin css in the child them style.css

As simple as adding !important to the css rule.

.some_class {
  color: #fff !important;
}

 resources