Advanced Web 2012 Lecture 11 Sean Costain 2012.

16
Advanced Web 2012 Lecture 11 Sean Costain 2012

Transcript of Advanced Web 2012 Lecture 11 Sean Costain 2012.

Page 1: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Advanced Web2012

Lecture 11

Page 2: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Page 3: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Page 4: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Wordpress ThemesThe make up of a word press site consists of a few types of files. These files are:- index.php- Page.php- Style.css- Header.php- Footer.php- Single.php- Sidebar.php

Themes are stored in the wp-content/themes folder

Page 5: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Index.phpThe index.php is the main page that is seen upon an end user entering the website.

The index file controls what the home page looks like. By default it contains a loop that queries and then displays the most recent blog posts, with a link at the bottom to view previous posts.

Alternately, you can specify in wp-admin>settings>read to have the home page be a page you created yourself in wordPress. In that case, you specify a different page/URL for the regular blog posts to appear on, and that page is generated by index.php

Page 6: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Page.php

Page.php controls what WordPress pages look like. You can choose to eliminate sidebars or other elements, or add other unique elements for pages alone.

WordPress also allows you to create different page templates for different types of pages. To create a page template simply copy page.php, rename it to whateveryou want, then add this code to the top:

<?php/*Template Name: Your NameHere*/?>

Page 7: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Single.php

Page 8: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Style.cssThis is the main CSS stylesheet for your theme.

It also contains text at the top which tells WordPress what your theme name is,who the author is, and what the URL of your site is.

Page 9: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Header, Footer, Sidebar & the Loop

Page 10: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Archive, Category, tag

Page 11: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

The Loop

The Loop is perhaps the most powerful part of your WordPress theme. It starts with a query (which determines which posts or pages to grab), and ends with a php endwhile statement. Everything in between ¡s up to you.

You can specify the output of titles, post content, metadata, custom fields, and commenting all within the loop, and each element is output for each post or page until the query is done.

You can set up multiple loops and queries on a single page; for example: on a single.php you could have the loop showing the entire content of a single post, with a loop outputting just titles and thumbnails for related posts below it.

Page 12: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Theme Examples

http://wordpress.org/extend/themes/pagelines

http://wordpress.org/extend/themes/eureka

Page 13: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Theme Examples Cont.

http://wordpress.org/extend/themes/easel

The theme you design is only limited to your imagination. For your assessment, make sure you push

the boundries of wordpress.

Think outside the Box!

Page 14: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Starting your theme

The easist way to start making your theme, is to copy and paste the twentyeleven folder and rename it to

your new theme name.

Page 15: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Creating theme cont.Open up your theme in expression web.- Modifiy style.css with your theme name

Page 16: Advanced Web 2012 Lecture 11 Sean Costain 2012.

Sean Costain 2012

Creating theme cont.Go to your localhost and login as admin. From here go to themes and you should see your theme listed.

Make your theme the active theme.

From here start playing with your style sheet for a look you are after