This document provides an introduction to HTML, CSS, and WordPress. It covers the basics of HTML including common tags for formatting text, images, and links. It then discusses using CSS to style HTML elements using classes, IDs, and other selectors. Finally, it gives an overview of how HTML and CSS are used together in WordPress templates and themes.
2. Building the basics
What we’re going to cover in 30 minutes or less.
- the who, what, where, when, and
why of the web;
- where this all came from;
- and how to use it;
4. The history of the web
What is the web?
- http:// is the hypertext transfer
protocol;
- https:// is the secure hypertext
transfer protocol;
5. The history of the web
What is the web?
- the HTTP transfers text files from a
server, to a web browser;
- the text files may be formatted in the
HyperText Markup Languages
6. The basics of HTML
What is HTML and how do we use it?
- HTML has ~10 basic tags
- document structure;
- paragraphs, lists, and formatting;
- images, and linking
7. The basics of HTML
structural tags
Document structure tags
<html>
<head></head>
<body></body>
</html>
8. The basics of HTML
paragraph tags
The Paragraph Tag
<p>Hello, I’m a paragraph.</p>
opening content closing
12. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph full of
amazing things that we’re going to
love.
13. The basics of HTML
lists
Lists
<li>This is a list item.</li>
opening content closing
<ul>
opening
</ul>
closing
(also <ol>)
14. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph full of
amazing things that we’re going to
love.
• This is a list item.
15. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph full of
amazing things that we’re going to
love.
1. This is a list item.
16. The basics of HTML
formatting tags
Formatting Tags
<b>This text is bold.</b>
opening content closing
<i>This text is italic.</i>
opening content closing
17. The basics of HTML
formatting tags
Formatting Tags
<strong>This text is strong.</strong>
opening content closing
<em>This text has emphasis.</em>
opening content closing
(also <tt>, <cite>, <font>, <blockquote>)
18. The basics of HTML
Formatting tags
Using Formatting tags in a <p>
<strong>This text is strong.</strong>
opening content closing
<p>
</p>
19. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph full of
amazing things that we’re going to
love.
1. This is a list item.
20. The basics of HTML
The line break
Using line breaks in a <p>
<br>
opening
<p>
</p>
(also <hr>)
21. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph. Full
of amazing things
that we’re going to love.
1. This is a list item.
22. The basics of HTML
the anchor tag
The Anchor Tag
<a href=“index.html”>text link</a>
attribute value
opening content closing
23. The basics of HTML
Adding a link tag
Using link tags into a list
<li> </li>
<a href=“index.html”>text link</a>
attribute value
opening content closing
24. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph.
Full of amazing things that we’re going
to love.
1. This is a list item.
25. The basics of HTML
The image tag.
The Image Tag
<img src=“image.jpg”>
opening
attribute value
x
(no closing)
26. This is a heading
Hello, I’m a paragraph.
This is an h2 heading.
And here is another paragraph.
Full of amazing things that we’re going to
love.
1. This is a list item.
28. The basics of HTML
Combining a tag
Combing two tags to link an image
<p> </p>
<a href=“index.html”><img
src=“image.jpg></a>
attribute value
opening
attribute value
opening closing
29. New(ish) HMTL tags
Some additions to the standards
- <div> is used to divide block content
on a page;
- <span> is used to divide inline
content;
<span>content</span>
<div>
</div>
30. New HMTL5 tags
Some additions to the standards
- <header>, <footer>, <nav>, <aside>,
<article> all replace <div> tags;
- <figure> (sort of) replaces <img> tag
31. The attributes of a tag
anchor tags
The Anchor Tag
<a href=“index.html”>text link</a>
attribute value content closing
opening
32. The attributes of a tag
paragraph tags
The Paragraph Tag
<p class=“first_paragraph
example_class”
attribute value
id=“opening”
attribute value
>my paragraph text</p>
34. The attributes of a tag
paragraph tags
The Paragraph Tag
<p class=“first_paragraph
example_class”
attribute value
id=“opening”
attribute value
>my paragraph text</p>
35. The attributes of a tag
paragraph tags
The Paragraph Tag
<p class=“first_paragraph
example_class”
id=“opening”
class
id
class
>my paragraph text</p>
36. Using the attributes in
CSS paragraph tags
The Paragraph Tag
<p class=“first_paragraph example_class”
id=“opening”>
class class id
.first_paragraph {}
.example_class {}
#opening {}
37. Using the attributes in
CSS paragraph tags
<div id=“first_div”>
<p class=“first_paragraph
example_class”>…</p>
<p>…</p>
<p class=“example_class”>…</p>
<ul><li class=“example_class”>…</li></p>
</div>
<div id=“second_div”>
<p class=“first_paragraph
example_class”>…</p>
<p class=“example_class”>…</p>
</div>
45. Using the attributes in
CSS cascading styles in html
<div id=“second_div”>
<p class=“first_paragraph
example_class”>…</p>
<p class=“example_class”>…</p>
</div>
46. Using the attributes in
CSS cascading styles in html
<div id=“second_div”>
<p class=“first_paragraph
example_class”>…</p>
<p class=“example_class”>…</p>
</div>
#second_div p
#second_div p
47. Using the attributes in
CSS cascading styles in html
<div id=“second_div”>
<p class=“first_paragraph
example_class”>…</p>
<p class=“example_class”>…</p>
</div>
.example_class
.first_paragraph
.example_class
48. Using the attributes in
CSS cascading styles in html
<div id=“second_div”>
<p class=“first_paragraph
example_class”>…</p>
<p class=“example_class”>…</p>
</div>
div p
div#second_div p
div#second_div
p.first_paragraph
div#second_div
p.example_class
p.example_class
p.first_paragraph
p
54. Using the template
how to overhridiee WroradPrrecssh payge templates
- WordPress will always search for
templates with -ID or -slug first;
- for example page-about.php or
archive-sales.php;
- WordPress waterfalls while
searching for page templates;
55. About PHP
Basic PHP usage
<title><?php echo ‘hello’; ?></title>
open php php command close php
56. Getting data from
WSomoe bradsicP cormemasndss
<title><?php bloginfo( ‘title’ ); ?></title>
open php close php
bloginfo fetches and displays
information stored in the
WordPress options table by
name.
What do you want to fetch from
the database?
57. Getting data from
WSomoe bradsicP cormemasndss
<?php $title = get_bloginfo( ‘title’ ); ?>
open php
get_bloginfo() fetches details
but doesn’t display it. It’s ideal
for reading data into a variable.
What do you want to fetch from
the database?
58. Basic WordPress
Some basicC WoordmPresms coammnadndss for the Loop
the_title(); the post title
the_excerpt(); the excerpt
the_author(); the author
the_id(); the post id
the_content(); the post content
59. Basic WordPress
Some mCoreo bamsic WmordaPrnesds csommands
get_posts( $args ); get a group of posts
get_post( $id ); get a specific post
get_the_title( $id ); get a post title
wp_mail( $args ); send an email
wp_insert_posts( $args
create a new post
);
human_time_diff() converts dates