theming wordpress for your showcases

57
Theming Wordpress for your showcase Mathias Funk Jun Hu

Upload: jun-hu

Post on 07-Nov-2014

670 views

Category:

Documents


4 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Theming Wordpress for Your Showcases

Theming Wordpress for your showcase

Mathias FunkJun Hu

Page 2: Theming Wordpress for Your Showcases

Summary

1. What is a CMS?2. Wordpress and some important tools– Hands-on

3. Content and styling - HTML and CSS– Hands-on

4. A simple theme– Hands-on

5. Building your showcase– Hands-on

6. Take away

Page 3: Theming Wordpress for Your Showcases

WEB SERVER VS. BROWSER + WHAT IS A CMS?

How to manage content on the web?

Page 4: Theming Wordpress for Your Showcases

Dynamic content

Internet ExplorerSafariFirefoxOpera…

Apache Microsoft IIS…

PHPColdFusionASPJSP…

MySQLPostgreSQLMS SQL ServerOracleDB2…

Page 5: Theming Wordpress for Your Showcases

Content Management Systems

Page 6: Theming Wordpress for Your Showcases

Content Management Systems

Page 7: Theming Wordpress for Your Showcases

WORDPRESS AND EDITORSInstallation guide and tools you will need

Page 8: Theming Wordpress for Your Showcases

Installing Wordpress

• http://codex.wordpress.org/Installing_WordPress

• Or Google “installing wordpress”

Page 9: Theming Wordpress for Your Showcases

Local Installation (Mac)

• http://codex.wordpress.org/Installing_WordPress_Locally_on_Your_Mac_With_MAMP

• Or Google “Wordpress MAMP”

• Alternative:– http://bitnami.org/stack/wordpress– Or google “bitnami wordpress”– Install the native stack for Mac

Page 10: Theming Wordpress for Your Showcases

Local Installation (Windows)

• Instead of Microsoft Web Platform Installer (Web PI), We will be using Bitnami Appliance– Experience with PhpMyAdmin and MySQL for later

migrating to a real web server.

Page 11: Theming Wordpress for Your Showcases

Bitnami Wordpress Stack

• http://bitnami.org/stack/wordpress• Or google “bitnami wordpress”• Download the native stack for Windows– Do select “PhpMyAdmin”– When asked, use “localhost” as the hostname.

Page 12: Theming Wordpress for Your Showcases

Bitnami Wordpress Stack

• Do select PhpMyAdmin

Page 13: Theming Wordpress for Your Showcases

Bitnami Wordpress Stack

• When asked, use “localhost” as the hostname.

Page 14: Theming Wordpress for Your Showcases

Bitnami Wordpress Stack

• Try http://localhost, If you have got it right:

Page 15: Theming Wordpress for Your Showcases

Bitnami Wordpress Stack

• By default, the Wordpress files are in:– C:\Program Files\BitNami WordPress Stack\apps\wordpress\htdocs– Or– C:\Program Files (x86) \BitNami WordPress Stack\apps\wordpress\htdocs

• http://localhost/phpmyadmin for database administration– User: administrator– Password: [your administration password selected during installation]

Page 16: Theming Wordpress for Your Showcases

Install a proper text editor

• Dreamweaver is overkilling.• NotePad++– http://notepad-plus-plus.org

• NotePad2– http://www.flos-freeware.ch/notepad2.html

• …

• “Run as Administrator” might be needed for editing the PHP scripts in Installed Wordpress.

Page 17: Theming Wordpress for Your Showcases

Install a proper text editor

• Dreamweaver is overkilling.• NotePad++– http://notepad-plus-plus.org

• NotePad2– http://www.flos-freeware.ch/notepad2.html

• …

• “Run as Administrator” might be needed for editing the PHP scripts in Installed Wordpress.

Page 18: Theming Wordpress for Your Showcases

Start/Stop Apache/Mysql services

• Start > – All programs > • Bitnami Wordpress Stack >

– Bitnami Wordpress Stack Service» Start/Stop Bitnami Wordpress Stack Service

http://dl.dropbox.com/u/2022550/wordpress_workshop.pptx

http://dl.dropbox.com/u/286741/WPWorkshop/helloworld.php

Page 19: Theming Wordpress for Your Showcases

BrowserApache PHP MySQL

• Hello World! <html><body><?php

mysql_connect (localhost, bitnami, ‘d26d69602c’);

mysql_select_db (bitnami_wordpress);$result = mysql_query ("

SELECT * FROM wp_postsWHERE post_title LIKE 'Hello World!'

");if ($row = mysql_fetch_array($result)) {

print $row["post_content"];print (" ");

} else {print "Sorry, no records were found!";

}?></body></html>

Page 20: Theming Wordpress for Your Showcases

HTML / CSS

Page 21: Theming Wordpress for Your Showcases

Content Structure

• Vision• Past

– Competencies– Feedback / results

• Present– Competencies– Projects– Assignments

• Future– Next semester– Bachelor / Master

One page: Text + Picture

Page 22: Theming Wordpress for Your Showcases

Separation of content and style

• Web

• MS Word

• LaTeX

• CMS

• …

CSS

B i u

B i u

Style

HTML

Text

Text

Content

Page 23: Theming Wordpress for Your Showcases

Examples

from: http://www.csszengarden.com/

Page 24: Theming Wordpress for Your Showcases
Page 25: Theming Wordpress for Your Showcases
Page 26: Theming Wordpress for Your Showcases
Page 27: Theming Wordpress for Your Showcases
Page 28: Theming Wordpress for Your Showcases
Page 29: Theming Wordpress for Your Showcases
Page 30: Theming Wordpress for Your Showcases
Page 31: Theming Wordpress for Your Showcases
Page 32: Theming Wordpress for Your Showcases

HTML

• Tags<h1> headline </h1><p> paragraph </p><a> link (anchor) </a><img>

• Attributes<a href=“http://www.tue.nl”>TU/e</a><img src=“tue_logo.png”>

Page 33: Theming Wordpress for Your Showcases

HTML

• Classes<h1 class=“main-title”><p class=“content-text”><p class=“content-text”><p class=“content-text”>

• Identifier<p id=“teaser” class=“content-text”>

Page 34: Theming Wordpress for Your Showcases

CSS

• Cascading Style Sheets• Style HTML files

CSS HTMLHTML

Page 35: Theming Wordpress for Your Showcases

CSS• Styling

Tagsh1 {

background-color: red;}

Classes.content-text {

font-style: italic;}

Identifier#teaser {

letter-spacing: 1px;}

• Style hierarchy#teaser a {

text-decoration: none;}

• Pseudo styles#teaser a:hover {

text-decoration: underline;}

Page 36: Theming Wordpress for Your Showcases

Units• Pixels (px)

p {width: 300px;

}• Points (pt)

p {font-size: 10pt;

}• Em unit (em)

p {line-height: 1.5em;

}depending on font size of parent element, em is a multiplier: Parent font size: 16px, then 1em is exactly 16px, 1.5em is 24px etc.

Page 37: Theming Wordpress for Your Showcases

Colors

Color name black red green blue white

RGB rgb(0, 0, 0) rgb(255, 0 , 0) rgb(0, 255 , 0) rgb(0, 0, 255) rgb(255, 255 , 255)

Hex #000000 #ff0000 #00ff00 #0000ff #ffffff

Yellow?

Hex shorthand:#aabbcc #abc#0033ff #03f

Page 38: Theming Wordpress for Your Showcases

Hands-on

• Download HTML and CSS file from: http://dl.dropbox.com/u/286741/WPWorkshop/example1.zip

• Google: “CSS reference”• Make this:

Page 39: Theming Wordpress for Your Showcases
Page 40: Theming Wordpress for Your Showcases

Box model

Page 41: Theming Wordpress for Your Showcases

Box model examples

border: 1px solid red;

padding: 5px;

margin: 0px 10px 10px 30px;margin: 0px 10px 10px;margin: 10px 0;

Page 42: Theming Wordpress for Your Showcases

Positioning• Default (static)

– Show and hide elements• display: none;• display: block | inline;

– Layout in order of appearance– Floating

• float: left | right;• clear: left | right | both;

• Absolute– Absolute positioning

• position: absolute;• top | left | right | bottom: 100px;

• Relative– Similar to static, but with top, left, right, bottom

• position: relative;• left : -10px;

• (Fixed)

Page 43: Theming Wordpress for Your Showcases

Hands-on

• Download HTML and CSS file from: http://dl.dropbox.com/u/286741/WPWorkshop/example2.zip

• Make this:

Page 44: Theming Wordpress for Your Showcases
Page 45: Theming Wordpress for Your Showcases

THEMES

Page 46: Theming Wordpress for Your Showcases

Where are the themes?

Page 47: Theming Wordpress for Your Showcases

Get a theme

http://wordpress.org/extend/themes/simplesthttp://wordpress.org/extend/themes/coraline

There are many more themes on the web…

Do not download and install a theme without checking it!

Page 48: Theming Wordpress for Your Showcases

Install theme

Page 49: Theming Wordpress for Your Showcases

Activating themes

Page 50: Theming Wordpress for Your Showcases

Widgets

Page 51: Theming Wordpress for Your Showcases

Inside a theme

page.php for pages

index.php for newest posts

single.php for a single post

search.php for search results

header.php

sidebar.php

footer.php

404.php for error page

styles.css

Content area

Page 52: Theming Wordpress for Your Showcases

Make vision page the first page

Page 53: Theming Wordpress for Your Showcases

BUILDING YOUR SHOWCASE

Page 54: Theming Wordpress for Your Showcases

Hands-on

• Choose a theme– Install it, activate it, choose widgets– Customize it with additional styling

• Content– Create page structure as pages: Vision, Past, …– Write simple clear text– Link out– Have pictures and even embedded videos

• Make Vision page first page

• Spread the word!

Page 55: Theming Wordpress for Your Showcases

TAKE AWAY

Page 56: Theming Wordpress for Your Showcases

Using Wordpress for real

• Check your layout with different browsers(at least Firefox, Safari, IE 8 + 9)

• Move from local to a real web server– Export local database, then import it on new server– Copy templates and settings (usually just wp-content)– Check wp_config.php for changes (Database account)– Dashboard/Settings: Wordpress/site address (URL)

• Activate– Caching (WP Super Cache)– Search engine access

• Keep WP updated

• Work on the content, a LOT!