Homework

Due Sunday 27th by 11:59 PST.

This homework only demonstrates a few basics with wordpress, and you are free to go further. The key to WordPress is usually customization of Themes and Plugins.  The rest is just content.  There are many pages on WordPress, and we should just the basics, expecting that you would look on-line at the myriad of tutorials to go further.  For this assignment you just need the basics.

Install

Download and install WordPress in your HTML directory.

cd ~/public_html/
wget http://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
mv index.html index.old.html
mv ~/public_html/wordpress/* ~/public_html
mkdir wp-content/uploads
cp wp-config-sample.php wp-config.php
chmod -R 775 ~/public_html/wp-content ~/public_html/wp-includes

Using vim. Edit wp-config.php such that these three lines match your username.

define( 'DB_NAME', 'davidwcr' );
/** MySQL database username */
define( 'DB_USER', 'davidwcr' );
/** MySQL database password */
define( 'DB_PASSWORD', 'davidwcr' );

Next, you need to add 4 lines to your wp-config.php file at the top.

define('WP_HOME','https://trgn.usc.edu/~davidwcr/');
define('WP_SITEURL','https://trgn.usc.edu/~davidwcr/');
$_SERVER["HTTPS"] = "on";
define('FS_METHOD', 'direct');

Note that you need to change your username as appropriate.

No go to the following page: https://trgn.usc.edu/~davidwcr except with your username.  Success to this point should look like:

Setup your administrator account first clicking on the 5-minute setup with install.php.  You can use any password you like.

You should then login and see a page like this.

Install a plug-in

First thing we will do is to install a plug-in.  Click on Plugins “Add New”, and install “Classic Editor”.

Please make it active.  If you are successful, clicking on Plugins should looks something like this:

Create a Home Page

Click on Pages on the left, and create a new page. You can call it Homepage.

Please type in “Header 1 Text” using header 1. Please make “Header 2 Test” using Header2 styling, “This is p style” in paragraph (p) style, and “ls -l” as a “codeblock”.  Please type “Here is a link to pubmed”, and make the word pubmed a link to “https://pubmed.ncbi.nlm.nih.gov/”.  Please type “This is custom styling.”, and edit the HTML (“Text” panel), to be a custom styling reading backwards by adding the style=”direction: ltr;unicode-bidi: bidi-override;”to the element.

Your page should look something like this:

Customizing Theme Appearance

In Appearance, click on customize.

We are only asking you to do a few changes, just to get the idea.  Lets set the homepage to the page we have created, and remove the widgets that dynamically add content.

Click on Homepage settings

In Appearance menu on left, click on Widgets.

Remove

Set up to use your “Homepage” that you just created to be the homepage.

 

Click on Widgets, and remove all the widgets for now.

Delete the current widgets.

Click “Publish” to finish setup.

Adding a menu

Lets add a menu, by clicking on Appearance->Menus.

Create a custom, giving it the name “Top Menu” and click Create Menu.

Please add the “Homepage” you created as the first menu item. For the second menu item, create a custom link to https://pubmed.ncbi.nlm.nih.gov/ labeled Pubmed.  Click to have it at Desktop Horizontal Menu location and the Mobile Menu.  Click Save Menu

To finish, your page should look something like this:

https://trgn.usc.edu/~davidwcr/