• Complain

Joe Casabona - Building WordPress Themes from Scratch

Here you can read online Joe Casabona - Building WordPress Themes from Scratch full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2012, publisher: CreateSpace, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Building WordPress Themes from Scratch
  • Author:
  • Publisher:
    CreateSpace
  • Genre:
  • Year:
    2012
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Building WordPress Themes from Scratch: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Building WordPress Themes from Scratch" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Included with the book is a WordPress theme and other necessary files, so roll up your sleeves and let Joe take you through the process explaining what you need to do and why youre doing it every step of the way. Who This Book is For Id like to say that this book is for anyone interested in WordPress, regardless of background. However, to keep it streamlined, I do assume that you have a solid understanding of HTML, CSS, javascript, PHP and MySQL. I will be looking at converting HTML to a WordPress theme, building plugins, and more, all from scratch. So, if youd like to learn how to do all of this, then this book will be right up your alley! What This Book Includes Packaged with this book, you will find: A fully functioning WordPress theme called Director. A set of PSD files for the Homepage, Directory Page, Blog, and Single Business Page. A set of HTML files created from the PSDs. They will be used to create the Director WordPress theme. On top of the four pages created from the PSDs, the HTML folder also includes a /css/ folder for four CSS files: style.css, reset.css, master.css, and ie.css. Plus you also get all images used in the HTML template. What This Book Covers This book reads much like a long, multi-part tutorial, where I take you through my design process, explaining what I do (and why I do it) every step of the way. Although its a fairly linear guide, my hope is that you can visit any main section of the book for quick reference. So, heres what Ill be doing: Converting HTML/CSS to a Dynamic WordPress Theme Included with the book is a PSD that Ive transformed into HTML. The first part of this book will be taking the resulting HTML/CSS and converting it to a WordPress theme. Along the way, Ill talk about the various theme pages were working with, the WordPress theme hierarchy, and of course, the WordPress Loop. Creating a Custom Post Type This, in my humble opinion, is one of the best additions to WordPress in recent releases. With the ability to make your own content types each with its own theme template you can take WordPress from being a CMS only limited to blog posts and pages, to a CMS that can manage any kind of content you can imagine. In this book, well be creating a business listing type, which will allow us to create a business directory. Theme Options and Widgets With WordPress, you can make a theme your own by adding a theme options page and custom widgets. In this section, well make it very easy for people who use our themes to add their own customizations without delving into the code or creating a child theme. Creating a Plugin One of the most powerful facets of WordPress is the fact that its pluggable. We can add functionality to our installation of WordPress without changing the core WordPress files. There are vast directories of both free and premium plugins available that vastly expand the capabilities of WordPress. In this final section of this book, we will build our own plugin.

Joe Casabona: author's other books


Who wrote Building WordPress Themes from Scratch? Find out the surname, the name of the author of the book and a list of all author's works by series.

Building WordPress Themes from Scratch — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Building WordPress Themes from Scratch" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Converting HTML to a WordPress Theme
Building Our HTML Theme

Included with this book are a few things: the Photoshop files (PSDs) from which the design came, the HTML templates I created from the PSDs, and the fully functional WordPress theme. While we won't be going over slicing and dicing the PSDs, I will take this opportunity to explain the HTML template to an extent, because I want you to be somewhat familiar with the basis for our WordPress theme. Going forward, keep in mind that we're building a business directory website. Here is a screenshot of what the design will look like:

Files Structure You will find four HTML files were going to convert one for - photo 1

Files & Structure

You will find four HTML files we're going to convert (one for each PSD):

  • index.html The homepage design
  • blog.html A blog post listing page
  • directory.html A business listing page
  • business.html A single business page

All of our themes pages will be derived from the markup on these pages.

You will also find two folders: an /images/ folder, where all theme images will go (there are not many), and a /css/ folder, where all of the CSS will go. Within the /css/ folder, there are four CSS files that make up a simple framework I use for styling my websites (thank you, Dan Cederholm). They are:

  • reset.css Your standard CSS reset for maximum browser compatibility.
  • master.css The crux of the matter. All of the main CSS lives here.
  • ie.css Any IE fixes go here. Luckily there arent too many.
  • style.css This will simply import the other three stylesheets (in the order Ive listed them here. That is very important).

You will also find a /img/ folder within the /css/ folder. Any images that are called within the CSS go in this folder.

Markup & CSS

If you take a look at one of the HTML files, I think you will see some pretty standard markup. I am using HTML5, which requires a few lines of code to make it work.

The first line is the doctype declaration, which is simply:

which will add HTML5 elements to the Document Object Model (DOM), so that we can add style definitions for them in our CSS, and if we so desire, we can manipulate them using JavaScript. The line is simply:

In plain English, this is saying, "If the browser is IE8 or lower, call this JavaScript." That's all we need; we can now use HTML5 as we please!

While that is outside the scope of this book (not that I'm an expert), flexible grids help us considerably with designing flexible, responsive websites.

In order to achieve this flexibility, I created a class called #container with the following definition:

#container { margin: 0 auto; text-align: left; width: 70%; /* Target: 940px; */ padding: 10px 0;}

I also have a few general CSS classes I use throughout the template. Since this is a 2-column layout, I created classes for both the left and right columns:

.left-col { width: 66%; float: left;}.right-col { float: right; width: 32%; margin-left: 2%;}

room, which I used for a margin to separate the two columns. I also have two separate but similar CSS classes to easily float individual elements left or right:

.left { float: left;}.right { float: right;}

These classes are also aptly named. To ensure none of these four classes extend past where they should and end up eating the rest of the page, I employ a nice little hack that Dan Cederholm came up with for self-clearing floats:

.group:after { content: "."; display: block; height: 0; clear: both; visibility: hidden;}

Now, for any containing div that has floating elements, we can also apply the class name group and everything will stay within the container:

One Fish
Two Fish

There is a fix we need to apply to make it work in IE 6 and 7, which you can find in the ie.css file:

* html .group { /* IE6 */ height: 1%;}*:first-child+html .group { /* IE7 */ min-height: 1px;}

I'll explain any other markup or CSS along the way. Right now, let's get in to actually building the theme! We'll start by creating our theme folder let's call it /director/ and copying the /css/ folder into it.

style.css/CSS

Whenever I convert an HTML template to a WordPress theme, I start first with style.css, since it's the easiest file to convert (plus, it defines the theme in WordPress). What I do is remove style.css from the /css/ directory and move it into the root theme directory (in this case /director/). At this point, our file structure looks like this:

Now were going to modify stylecss a bit Open it up in your favorite text - photo 2

Now, we're going to modify style.css a bit. Open it up in your favorite text editor, and start by adding the theme definition at the very top, starting at line 1:

/*Theme Name: DirectorTheme URI: http://www.envato.comDescription: A business directory theme.Version: 1.0Author: Joe CasabonaAuthor URI: http://www.casabona.org*/

This gives WordPress everything it needs to know to list our theme in the Themes > Appearance section of our WordPress installation. There is one more thing we need to do to this file, and that's adjust the references to the other stylesheets. Since we moved style.css up one directory, we'll need to change each import to include "css/" like so:

@import url("css/reset.css");@import url("css/master.css");@import url("css/ie.css");

Much better! Our CSS is now all set up and ready to use. Before we move on though, I want to add some CSS to css/master.css to account for WordPress's default classes to position images through the editor. So let's open up master.css and add this code:

img.centered, .aligncenter, div.aligncenter { display: block; margin-left: auto; margin-right: auto;}.alignright { float: right;}.alignleft { float: left;}

Next, let's add some default styles to be used when the user adds a caption:

.wp-caption { border: 1px solid #ddd; text-align: center; background-color: #d4d4d4; padding-top: 4px; margin: 10px;}.wp-caption img { margin: 0; padding: 0; border: 0 none;}.wp-caption p.wp-caption-text { font-size: 0.85em; line-height: 1.214em; padding: 0 4px 5px; margin: 0;}

Perfect! With that taken care of, let's move on to the second half of our theme prep-work, which is creating the functions.php file.

Functions.php

The functions.php file is where you make your theme magic happen. It's worth noting that you do not need this particular file, but according to the WordPress codex:

You can add features like sidebars, navigation menus, thumbnail support, and more. We'll also employ the help of our functions.php file later on to declare our custom post type, but for now, we're just going to:

  • Define two constants that well use in our theme.
  • Add menu support.
  • Add support for a sidebar.

So in the /director/ folder, create a

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Building WordPress Themes from Scratch»

Look at similar books to Building WordPress Themes from Scratch. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Building WordPress Themes from Scratch»

Discussion, reviews of the book Building WordPress Themes from Scratch and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.