A WordPress Theme, Html Structure Of Creation.-zibba

Web-Design When coding a web site, you Should have two goals in mind: lean code and meaningful code. That is, using as little markup (HTML tags) as possible and making sure That The markup is meaningful by using semantic class names and ID That refer to their content, not how they "look" (class = ‘widget-area "instead of class = "sidebar-left"). Now, when coding a WordPress theme (or any template for any Content Management System), a balance is going to have to be Struck between lean markup, with very little structure, and what’s called Divitis, including too many unnecessar div elements in your code. In other words, too much meaningleKai coding a website, you should have two goals in mind: lean code and sense code. This means that using as little markup (HTML tags) as possible, and to ensure meaningful use of semantic markup class and ID names to link to their content, not how they "look" (class = "Control Zone" rather than class = "sidebar-left"). Now, when coding a WordPress theme (or any of any content management system template) is going to be a balance struck between lean markup, very little structure, and what’s called Divitis, including too many unnecessary div elements in your code. In other words, too many meaningless structure. You’ve probably seen the div tag before, if you looked at the code on the website or in any WordPress theme. Think of them as HTML code containers that are very easy to manipulate HTML with CSS containers. Obviously, we’re going to have some. However, we do not want too much or those without a sense. Aste this code into your text editor and save somewhere handy. We use it later when we create a file structure, our WordPress theme. But before that, there are a few things we want to look at here. Quick view within your WordPress Theme HTML First, on the wrapper class attribute hfeed. "Hfeed hatom microformat part of the scheme. Plain English, this means that adding that hfeed class to our page that tells our site (such as search engine robots or some other service) to our site to publish syndicated content as blog reading any machines. names you’ll be seeing a lot of classes like this as we go along. Viewing div structure of the header and footer, you’ve probably noticed, what I call the inner outer structure. This is one of the few places (I hope) that our structure can potentially be blamed Divitis. Can. Borrowing from the class names in the publishing world (WordPress allows us to publishers, right), I tried to add a bit of sense tagging, which will end up those containers. Marking to add this tutorial series and markup that will be added in the future. In addition, the .pletion of certain models, we need this markup structure. It is better to add it now and do it right. Well the above HTML structure visualization. The shaded block, the deeper it is inserted. Most of these units is determined from the layout using CSS, which we’ll cover later lesson. You can also change the HTML structure to suit your needs. For example, you can move the navigation block at the header block, or move one object fields in the footer block. In this tutorial, though, we keep the HTML structure, as and when we get to it, use CSS to take care of your website content and widget areas. It’s okay, let’s go through the code bit.In our HTML, please note that our widget areas will .e after us in the main content area. And you’ll also notice that our content has a container div (with a class called "content area"). These points are key. This not only makes our leading content to .e before your eyes search the sidebars (and screen readers), but using the CSS method of negative margins, we can do it in 1 or 2 column theme with just a few lines of CSS. The HTML structure of the future is going to your WordPress theme, and give you the ability to do powerful stuff with CSS. This gera.ss page. You’ve probably seen the div tag before if you’ve looked at the code for a website or any WordPress Theme. Think of them as containers for HTML-code containers That are very handy for manipulating HTML with CSS code. Obviously we’re going to have some. But we do not want too many or ones without Meaning. Aste this code into your text editor and save it somewhere handy. We’ll be using it later when we build the file structure for our WordPress Theme. But before we do that, there are a few things we’ll want to take a look at here. A Quick Tour Through Your WordPress Theme HTML Firstly, the class attribute on the wrapper, hfeed. hfeed is part of the hatom Microformats scheme. In plain English, this Means That That hfeed adding to our class page tells any machines reading our site (like search-engine bots or some other service) That our site publishes Syndicated content, like blog posts. You’ll be seeing a lot of class names like this as we go along. Looking at the structure div for the header and footer you’ve probably noticed what I’ll call an inner-outer structure. This is one of the few places (hopefully) That our structure could potentially free accused of Divitis. Potentially. Borrowing class names from the publishing world (WordPress makes us content publishers, right), I’ve tried to add some markup to the Meaning That Will Be Resting In These containers. Markup That we’ll be adding in this tutorial series and markup That will may no added in the future. Plus, it was certain ac.plishe layouts, we’ll need this markup page. It’s better to add it now and do it right. heck out the visualization of the HTML structure above. The Darker a block, the deeper it is nested. The arrangement of under these blocks are Determined largely by CSS Which we’ll cover in a later lesson. You can also modify the HTML structure itself to suit your needs. For example, you can move the navigation block outside of the header block, or move one of the widget areas into the footer block. For the Purposes of this tutorial, though, we’ll keep the HTML structure as is, and when we get to it, use CSS to arrange our content and widget areas. All right, let’s walk through the code a bit.In the main area of ??our HTML, note that our widget areas .e after our content area. And you may also have noticed that our content rests inside a container div (with the class name of "content-area"). These points are key. This not only lets our main content .e before the Sidebars in the eyes of search engines (and screen readers), but by using a CSS technique Involving negative pattern, we can make this into a 1 – or 2-column theme with only a few lines of CSS. This HTML structure is going to future-proof your WordPress Theme and give you the OPPORTUNITY to do powerful stuff with CSS. It’s a good one. About the Author: 相关的主题文章: