<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hv-designs &#187; Wordpress Tutorials</title>
	<atom:link href="http://www.hv-designs.co.uk/category/wordpress-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hv-designs.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 10 Feb 2012 07:01:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>WordPress Posts Explained&#8230;</title>
		<link>http://www.hv-designs.co.uk/2009/09/11/wordpress-posts-explained/</link>
		<comments>http://www.hv-designs.co.uk/2009/09/11/wordpress-posts-explained/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 14:53:27 +0000</pubDate>
		<dc:creator>Packt Publishing</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1596</guid>
		<description><![CDATA[Once your WordPress installation is up and running, you are ready to start blogging. WordPress is the right choice for blogging because it&#8217;s quite a powerful tool with a seemingly infinite array of options and possibilities. The main focus of this article is to explain how to make a blog post and how to control [...]]]></description>
			<content:encoded><![CDATA[<p>Once your WordPress installation is up and running, you are ready to start blogging. WordPress is the right choice for blogging because it&#8217;s quite a powerful tool with a seemingly infinite array of options and possibilities.<br />
<span id="more-1596"></span><br />
The main focus of this article is to explain how to make a blog post and how to control all of the information for that post, and not just the title and content. In this article by Hasin Hayder and April Hodge Silver, we will explore how to keep your content organized and searchable using tags and categories.</p>
<h2>Adding A Simple Post</h2>
<p>Let&#8217;s review the process of adding a simple post to your blog. Whenever you want to do maintenance on your WordPress website, you have to start by logging in to the WP Admin (WordPress Administration panel) for your site. To get to the admin panel, just point your web browser to http://yoursite.com/wp-admin.</p>
<p><em>Remember that if you have installed WordPress in a subfolder (for example, blog), then your URL has to include the subfolder (that is, http://yoursite.com/blog/wp-admin).</em></p>
<p>When you first log into the WP Admin, you&#8217;ll be at the Dashboard. The Dashboard has a lot of information on it. The very top bar, which I&#8217;ll refer to as the top menu, is mostly dark grey and on the left, of course, is the main menu. The top menu and the main menu exist on every page within the WP Admin. The main section on the right contains information for the current page you&#8217;re on. In this case, we&#8217;re on the Dashboard. It contains boxes that have a variety of information about your blog, and about WordPress in general.</p>
<p>The quickest way to get to the Add New Post page at any time is to click on the New Post link at the top of the page in the top bar (top menu).</p>
<p>This is the Add New Post page:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/01.png" alt="01" width="600" height="549" /></p>
<p>To quickly add a new post to your site, all you have to do is:</p>
<p>&#8211;Type in a title into the text field under Add New Post (for example, Making Lasagne).&#8211;<br />
&#8211;Type the text of your post in the content box. Note that the default view is Visual, but you actually have a choice of the HTML view as well.&#8211;<br />
&#8211;Click on the Publish button, which is at the far right. Note that you can choose to save a draft or view a preview of your post.&#8211;</p>
<p>In the following image, the title field, the content box, and the Publish button of the Add New Post page are highlighted:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/02.png" alt="02" width="600" height="276" /></p>
<p>Once you click on the Publish button, you have to wait while WordPress performs its magic. You&#8217;ll see yourself still on the Edit Post page, but now the following message has appeared telling you that your post was published and giving you a link to View post:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/03.png" alt="03" width="538" height="222" /></p>
<p>If you go to the front page of your site, you&#8217;ll see that your new post has been added at the top (newest posts are always at the top):</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/04.png" alt="04" width="600" height="624" /></p>
<h2>Common Post Options</h2>
<p>Categories and tags are two similar types of information that you can add to a blog post. We use them to organize the information in your blog by topic and content (rather than just by, say, date), and to help visitors find what they are looking for on your blog.</p>
<p>Categories are primarily used for structural organizing. They can be hierarchical. A relatively busy blog will probably have at least 10 categories, but probably not more than 15 or 20. Each post in this blog will likely have one to four categories assigned to it. For example, a blog about food might have these categories: Cooking Adventures, In The Media, Ingredients, Opinion, Recipes Found, Recipes Invented, and Restaurants.</p>
<p>Tags are primarily used as shorthand for describing the topics covered in a particular blog post. A relatively busy blog will have anywhere from 15 to 30 tags in use. Each post in this blog will likely have three to ten tags assigned to it. For example, a post on the food blog about a recipe for butternut squash soup may have these tags: soup, vegetarian, autumn, hot, easy.</p>
<p>Let&#8217;s add a new post to the blog. This time, we&#8217;ll give it not only a title and content, but also tags and categories. When adding tags, just type your list of tags into the Tags box on the right, separated by commas:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/05.png" alt="05" width="283" height="111" /></p>
<p>Then click on the Add button. The tags you just typed in will appear below the text field with little xs next to them. You can click on an x to delete a tag. Once you&#8217;ve used some tags in your blog, you&#8217;ll be able to click on the Choose from the most popular tags link in this box so that you can easily re-use tags.</p>
<p>Categories work a bit differently than tags. Once you get your blog going, you&#8217;ll usually just check the boxes next to existing categories in the Categories box. In this case, as we don&#8217;t have any existing categories, we&#8217;ll have to add one or two.</p>
<p>In the Categories box on the right, click on the + Add New Category link. Type your category into the text field and click on the Add button. Your new category will show up in the list, already checked. Look at the following screenshot:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/06.png" alt="06" width="285" height="270" /></p>
<p>If in the future you want to add a category that needs a parent category, select Parent category from the pull-down menu before clicking on the Add button. If you want to manage more details about your categories, move them around, rename them, assign parent categories, and assign descriptive text. You can do this on the Categories page, which we&#8217;ll see in detail later in this article.</p>
<p>Now fill in your title and content here:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/07.png" alt="07" width="600" height="389" /></p>
<p>Click on the Publish button and you&#8217;re done. When you look at the front page of your site, you&#8217;ll see your new post on the top, your new category in the sidebar, and the tags and category (that you chose for your post) listed under the post itself:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/08.png" alt="08" width="600" height="450" /></p>
<h2>Adding An Image To A Post</h2>
<p>You may often want to have an image show up in your post. WordPress makes this very easy. Let&#8217;s add an image to the post we just created. You can click on Edit underneath your post on the front page of your site to get there quickly. Alternatively, go back to the WP Admin, open Posts in the main menu, and then click on Edit underneath your new post.</p>
<p>To add an image to a post, first you&#8217;ll need to have that image on your computer. Before you get ready to upload an image, make sure that your image is optimized for the Web. Huge files will be uploaded slowly and slow down the process of viewing your site. You can re-size and optimize images using software such as GIMP or Photoshop. For the example in this article, I have used a photo of butternut squash soup that I have taken from the website where I got the recipe, and I know it&#8217;s on the desktop of my computer. Once you have a picture on your computer and know where it is, follow these steps to add the photo to your blog post:</p>
<p>Click on the little photo icon, which is next to the word Upload/Insert and below the box for the title: </p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/09.png" alt="09" width="482" height="220" /></p>
<p>In the box that appears, click on the Select Files button and browse to your image. Then click on Open and watch the uploader bar. When it&#8217;s done, you&#8217;ll have a number of fields you can fill in: </p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/10.png" alt="10" width="600" height="632" /></p>
<p>The only fields that are important right now are Title, Alignment, and Size. Title is a description for the image, Alignment will tell the image whether to have text wrap around it, and Size is the size of the image. As you can see, I&#8217;ve chosen the Right alignment and the Thumbnail size.</p>
<p>Now click on Insert into Post. This box will disappear, and your image will show up in the post on the edit page itself: </p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/11.png" alt="11" width="537" height="421" /></p>
<p>Now click on the Update Post button and go look at the front page of your site again. There&#8217;s your image! </p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/12.png" alt="12" width="503" height="389" /></p>
<p>You may be wondering about those image sizes. What if you want bigger or smaller thumbnails? You can set the pixel dimensions of your uploaded images and other preferences by opening Settings in the main menu and then clicking on Media. This takes you to the Media Settings page:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/13.png" alt="13" width="600" height="261" /></p>
<p>Here you can specify the size of the uploaded images for:</p>
<p>&#8211;Thumbnail&#8211;<br />
&#8211;Medium&#8211;<br />
&#8211;Large&#8211;</p>
<p>If you change the dimensions on this page and click on the Save Changes button, only images you upload in the future will be affected. Images you&#8217;ve already uploaded to the site will have had their thumbnail, medium, and large versions created already using the old dimensions.</p>
<h2>Using The Visual Editor Vs The HTML Editor</h2>
<p>WordPress comes with a Visual editor, otherwise known as a WYSIWYG editor (pronounced wissy-wig, which stands for What You See Is What You Get). This is the default editor for typing and editing your posts. If you&#8217;re comfortable with HTML, you may prefer to write and edit your posts using the HTML editor—particularly useful if you want to add special content or styling.</p>
<p>To switch from the rich text editor to the HTML editor, click on the HTML tab next to the Visual tab at the top of the content box:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/14.png" alt="14" width="600" height="149" /></p>
<p>You&#8217;ll see your post in all its raw HTML glory and you&#8217;ll get a new set of buttons that lets you quickly bold and italicize text as well as add link code, image code, and so on. You can make changes and swap back and forth between the tabs to see the result.</p>
<p><em>If you want the HTML tab to be your default editor, you can change this on your Profile page. Navigate to Users | Your Profile, and select the Disable the visual editor when writing checkbox.</em></p>
<h2>Drafts, Timestamps, and Managing Posts</h2>
<p>WordPress gives you the option to save a draft of your post so that you don&#8217;t have to publish it right away but can still save your work. If you&#8217;ve started writing a post and want to save a draft, just click on the Save Draft button at the right (in the Publish box), instead of the Publish button. Even if you don&#8217;t click on the Save Draft button, WordPress will attempt to save a draft of your post for you about once a minute. You&#8217;ll see this in the area just below the content box. The text will say Saving Draft&#8230; and then the time of the last draft saved:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/15.png" alt="15" width="521" height="173" /></p>
<p>At this point, after a manual save or an auto-save, you can leave the Edit Post page and do other things. You&#8217;ll be able to access all of your draft posts from the Dashboard or from the Edit Posts page.</p>
<p>WordPress will also let you alter the timestamp of your post. This is useful if you are writing a post today that you wish you&#8217;d published yesterday, or if you&#8217;re writing a post in advance and don&#8217;t want it to show up until the right day. The default timestamp will always be set to the moment you publish your post. To change it, just find the Publish box and click on the Edit link (next to the calendar icon and Publish immediately), and fields will show up with the current date and time for you to change:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/16.png" alt="16" width="209" height="78" /></p>
<p>Change the details, click on the OK button, and then Publish your post (or save a draft).</p>
<p>If you want to see a list of your posts so that you can easily skim and manage them, you just need to go to the Edit Posts page in the WP Admin by navigating to Posts in the main menu. You&#8217;ll see a detailed list of your posts, as seen in the next screenshot:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/17.png" alt="17" width="600" height="312" /></p>
<h2>Advanced Post Options</h2>
<p>By now, you have a handle on the most common and simple options for posts and you may be wondering about some of the other options on the Edit Post page. We&#8217;ll cover them all in this section.</p>
<p><em>A quick display tip:<br />
When you first visit the Edit Post page, all of the four advanced options (Excerpt, Send Trackbacks, Custom Fields, and Discussion) are &#8216;open&#8217; below the post content. If you never use them and want to clean up the look of this page, you can single-click each bar and they&#8217;ll collapse. You can also rearrange them by dragging them to a new order. You can also use Screen Options (top right of the page) to uncheck certain boxes, and thus not display them at all.</em></p>
<h2>Excerpt</h2>
<p>WordPress offers theme designers the option to show a post&#8217;s excerpt (instead of its full content) on pages within the theme. If you enter some text into the excerpt box on the Edit Post page, that text will be used as the post&#8217;s excerpt on theme pages that call for it. However, if there is no text in this box, WordPress will use the first 55 words of the post&#8217;s content (which is stripped of HTML tags) followed by […] (which is not a link).</p>
<p>The more tag should not be confused with the excerpt. This is different from the excerpt because you, not the theme designer control its use. Text before this tag, for any post that has it, will be the only thing that&#8217;s shown on all blog pages (for example homepage, category page, search results page, and so on). The full post text will only show up on the post page. All you have to do is put the more link at the spot in your post where you&#8217;d like the cut-off to be. WordPress will automatically cut off the post there and replace it with a Read the rest of this post link.</p>
<p>To add this tag to a post, first place your cursor in the spot where you&#8217;d like the post to be split up. Then click on the more tag button in the editor. If you&#8217;re using the Visual editor, the button you want to click looks like this:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/18.png" alt="18" width="30" height="28" /></p>
<p>If you&#8217;re using the HTML editor, the button looks like this:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/19.png" alt="19" width="54" height="32" /></p>
<h2>Trackbacks</h2>
<p>Trackbacks are useful if you write a blog post that is a response to a post on someone else&#8217;s blog and you want them to know about it. Just copy the trackback URL from that person&#8217;s blog post and paste it into this box. An excerpt of your blog post will show up as a comment on their blog post.</p>
<p>If someone wants to display a blog post on their blog about a post on your blog using the default theme, he or she can find the trackback URL on the post page for every post. For example, click on the title of one of your posts on your blogs&#8217; front page and you&#8217;ll go to the post page:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/20.png" alt="20" width="458" height="337" /></p>
<p>All this person has to do is right-click on the trackback link and select Copy Link Location, which in this case is <em>http://packt:8888/2008/11/a-great-sandwich/trackback/.</em> If permalinks are not turned on, it would be <em>http://packt:8888/wptrackback.php?p=6.</em></p>
<p>Trackbacks are becoming somewhat out-of-date with the advent of pinging. In fact, many WordPress themes are written to essentially disable trackbacks. Pinging is WordPress&#8217;s way of notifying popular update services, such as Ping-o-Matic!, which other people use to keep up-to-date with your blog and other people&#8217;s blogs. We will explain more about pinging in the following section.</p>
<h2>Discussion</h2>
<p>A Discussion box has two checkboxes in it: one for allowing comments, and the other for trackbacks and pingbacks. When you first install WordPress, both these checkboxes will be checked by default. You have to uncheck them if you want to turn off the comments or trackbacks and pingbacks for the post.</p>
<p>Pingbacks are essentially the same as trackbacks, but differ in two important ways:</p>
<p>The notification from your blog to the blog of the person you&#8217;re commenting on happens automatically—you don&#8217;t have to enter a special URL into a special field. All you have to do is link your blog post to their blog post.<br />
Pingbacks don&#8217;t send any content.<br />
If you uncheck the comments box, visitors will not be able to comment on this blog post.</p>
<p>If you uncheck the trackbacks and pingbacks box, when other people mention your blog post and link to it on their own websites, your blog post won&#8217;t notice and won&#8217;t care. So, if you are using WordPress to run a non-blog website, this is the best option for you.</p>
<p>If the box stays checked, other people&#8217;s pingbacks about this post will show up under your post along with comments, if any. If you&#8217;re using WordPress to run a blog website, you&#8217;ll want pingback to stay checked—especially if you want sites such as Technorati and other rating/authority sites to stay alerted.</p>
<p>If you want either or both of these boxes to be unchecked by default, go to Settings and then Discussion in the main menu. You can uncheck either or both of the boxes labeled Allow link notifications from other blogs (pingbacks and trackbacks.) and Allow people to post comments on the article:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/21.png" alt="21" width="600" height="113" /></p>
<h2>Custom Fields</h2>
<p>Custom Fields are a way for you to add additional information about your blog posts that are not part of WordPress by default. By default, every WordPress post has a number of pieces of information (fields) such as title, content, date, categories, and so on. If there is a field you want all or many of your posts to have, you can add it here.</p>
<p>For example, let&#8217;s say you are a gadget reviewer and every blog post is a review of some new gadget. Every time you write a review, you&#8217;re writing it about a product made by some company, and you&#8217;d like to have that company&#8217;s logo associated with the blog post. You can make a custom field called company_logo and the value can be the path to the logo image.</p>
<p>To use this custom field information, you either have to manually modify your theme files, or use a plugin.</p>
<h2>Password &#038; Private Protection</h2>
<p>WordPress gives you the option to hide posts. You can hide a post from everyone but yourself by marking it Private, or you can hide it from everyone but the people with whom you share a password by marking it as Password protected. To implement this, look at the Publish box at the upper right of the Edit Post page. If you click on the Edit link next to Visibility: Public, a few options will appear:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/22.png" alt="22" width="217" height="120" /></p>
<p>If you click on the Password protected radio button, you&#8217;ll get a box where you can type a password. Visitors to your blog will see the post title along with a note that they have to type in a password to read the post.</p>
<p>If you click on the Private radio button, the post will not show up on the blog at all to any viewers, unless you are the viewer and you are logged in.</p>
<p>If you leave the post Public and check the Stick this post to the front page checkbox, this post will be the first post on the front page, regardless of its publication date.</p>
<p>Be sure to click on the OK button if you make any changes.</p>
<h2>Post Slug</h2>
<p>This box may not be visible by default, in which case you have to open Screen Options at the top of the page and check the box next to Post Slug.</p>
<p>The post slug is used in the URL if your blog is using permalinks. Permalinks are a way to prettify your URLs. For example, right now, the URL for my Butternut Squash soup post is <em>http://packt:8888/?p=10.</em> If I turn on permalinks, by default the URL would be <em>http://packt:8888/2008/11/butternut-squash-soup/.</em> The very last part of the URL, butternut-squash-soup, is the slug. WordPress chose the slug by taking my post title, making it all lowercase, removing all punctuation, and replacing spaces with dashes. If I&#8217;d prefer it to be something else, such as squash-soup, this Post Slug box is where I can change it. The slug is something that Google search loves, so using them helps to optimize your site for search engines.</p>
<h2>Adding Writing Options</h2>
<p>WordPress offers a neat bookmark called Press This. You can put it into your browser&#8217;s bookmarks or favorites, which will let you quickly write a blog post about the website you&#8217;re visiting. (This used to be called the bookmarklet.) You may have encountered this same feature as offered by Facebook, Del.ico.us, and other social networking sites.</p>
<p>You just have to add Press This to your browser once, and then you can use it anytime. To add the Press This link to your browser in the WP Admin, go to the Tools menu. At the bottom of the Tools page is a Press This link. Just grab it with your mouse and drag it up to your browser&#8217;s bookmark bar.</p>
<p>Now it&#8217;s available to you. For example, if you&#8217;re reading a newspaper website and you read an article you&#8217;d like to mention in a blog post, just click the Press This bookmark (or favorite). A window will pop up with the Edit Post page in it and the URL of the site you&#8217;re looking at already written in as a link:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/23.png" alt="23" width="600" height="522" /></p>
<p>You can then write whatever additional text you want, add tags and categories, and then either save it as a draft or publish it right away.</p>
<h2>Posting Via Email</h2>
<p>If you want to add a post to your blog without having to open the WP Admin and log in, you can set up your WordPress installation to accept posts sent via email. First, you have to set up a special secret email address that is accessible via POP. WordPress will check that email address and turn any emails in it into posts. So you have to be sure not to use this email address for any other purpose!</p>
<p>Once you have the email address set up at your mail server, go to your WP Admin and navigate to Settings | Writing. Scroll down a bit to Post via e-mail:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/24.png" alt="24" width="600" height="255" /></p>
<p>Now just enter the server, login name, and password into the Writing Settings page and be sure to click on the Save Changes button</p>
<h2>Adding and Managing Categories</h2>
<p>Earlier in this article, you learned how to quickly add a category when adding a post. Now let&#8217;s talk about how to manage your categories in a bigger way. First, navigate to Posts | Categories in your WP Admin. You&#8217;ll see the Categories page:</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/25.png" alt="25" width="600" height="543" /></p>
<p>This is a useful page that combines the ability to add, edit, and review all of your categories. As you can see, any categories you&#8217;ve added via the Edit Post page are listed. You can Edit, Quick Edit, or Delete any category by clicking on the appropriate link in the list.</p>
<p>If you add a category on this page, you can also choose its slug. The slug is the short bit of text that shows up in the URL of your site if you have permalinks enabled. If you don&#8217;t choose a slug, WordPress will create one for you by taking the category name, reducing it to all lowercase, replacing spaces with dashes, and removing any other punctuation marks.</p>
<p>Another thing you can do on this page is choose a parent category for any category. If you choose to use parent categories, your categories will be displayed hierarchically, just as your pages are displayed.</p>
<h2>Summary</h2>
<p>In this article you learned everything you need to know to add content to your blog and manage that content. You learned about posts and categories. You discovered tags and excerpts. You also learned about adding images, using the rich text editor, changing timestamps, customizing excerpts, and the different ways of posting.</p>
<h2>Liked This Article? Why Not Buy The Book</h2>
<p>Create your own complete blog or web site from scratch with WordPress.</p>
<p><img src="http://www.hv-designs.co.uk/articles/packt_publishing/wordpress01/the_book.png" alt="Buy The Book" width="100" height="123" /></p>
<p><a href="http://www.packtpub.com/wordpress-2-7-complete-2nd-edition/book/sl/wordpresscomplete-abr1/0509?utm_source=sl_wordpresscomplete_abr1_0509&#038;utm_medium=content&#038;utm_campaign=sanjiv">Learn More&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/09/11/wordpress-posts-explained/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>About The Author</title>
		<link>http://www.hv-designs.co.uk/2009/08/13/about-the-author/</link>
		<comments>http://www.hv-designs.co.uk/2009/08/13/about-the-author/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 20:37:35 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1551</guid>
		<description><![CDATA[Hello everybody welcome to tutorial 221, in this tutorial il show you how to hard code an &#8220;about the author box&#8221; at the bottom of every post. What We&#8217;ll Be Creating Firstly let me show you what we&#8217;ll be creating, recently i added an about the author box to this blog. Located at the bottom [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everybody welcome to tutorial 221, in this tutorial il show you how to hard code an &#8220;about the author box&#8221; at the bottom of every post.</p>
<p><span id="more-1551"></span></p>
<h2>What We&#8217;ll Be Creating</h2>
<p>Firstly let me show you what we&#8217;ll be creating, recently i added an about the author box to this blog. Located at the bottom of every post you will see a grey box which looks like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_author/step1.gif" alt="Step1" width="600" height="400" /></p>
<p>The way its constructed is really easy, we&#8217;ll use simple CSS and HTML for the box and the way its looks then we&#8217;ll use author template tags to add the dynamic content, which includes the thumbnail.</p>
<p><em>You can see all the tags associated with the author tag within wordpress <a href="http://codex.wordpress.org/Template_Tags/the_author">here</a></em></p>
<h2>The Box HTML Markup</h2>
<p>The HTML has to be added within the wordpress loop, the HTML markup for the box looks like this.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;article-author&quot;&gt;&lt;!--ABOUT AUTHOR STARTS--&gt;

&lt;h3&gt;About The Author: Richard Carpenter&lt;/h3&gt;

&lt;div id=&quot;author-image&quot;&gt;&lt;!--AUTHOR IMAGE--&gt;
&lt;img src=&quot;http://www.hv-designs.co.uk/site_images/author_images/01.gif&quot; alt=&quot;About The Author&quot; /&gt;
&lt;/div&gt;&lt;!--END AUTHOR IMAGE--&gt;

&lt;div id=&quot;author-text&quot;&gt;&lt;!--AUTHOR TEXT STARTS--&gt;
&lt;p&gt;Hi im Richard Carpenter im a freelance web and graphics designer from England. I am also a regular Blogger, Tutorial Writer, and owner of HV-Designs. You can follow me on twitter HERE. You may also view my portfolio HERE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
Richard Carpenter has written 254 posts.
&lt;/div&gt;&lt;!--AUTHOR TEXT ENDS--&gt;

&lt;/div&gt;&lt;!--ABOUT AUTHOR ENDS--&gt;
</pre>
<p>We start off with a DIV of &#8220;article-author&#8221;, within that DIV we add our header wrapped in a H3 tag. Yours might be a different header depending on how your blog is designed and coded.</p>
<p>Still inside the &#8220;article-author&#8221; DIV there&#8217;s two more DIV&#8217;s &#8220;author-image&#8221; and &#8220;author-text&#8221;. The &#8220;author-image&#8221; DIV will contain our 80px X 80px thumbnail image and the &#8220;author-text&#8221; DIV will contain our text. Pretty straight forward stuff. </p>
<h2>The Box CSS Styles</h2>
<p>The CSS styles for the HTML markup look like this.</p>
<pre class="brush: css; title: ; notranslate">
#article-author {
float: left;
width: 598px;
margin-top: 30px;
border: 1px solid #d9d9d9;
background-color: #E9E9E9;
padding: 10px;
clear: both;
}

#article-author a {
color: #56b0d8;
}

#article-author a:hover {
color: #000;
}

#author-image {
float: left;
height: 80px;
width: 80px;
border: 1px solid #d9d9d9;
background-color: #FFFFFF;
padding: 10px;
}

#author-text {
float: left;
width: 486px;
margin-left: 10px;
margin-top: 8px;
}

#author-text p {
font-size: 12px;
line-height: 18px;
}

h3 {
color: #000000;
text-transform: capitalize;
font-weight: normal;
font-size: 18px;
letter-spacing: -1px;
margin-bottom: 10px;
}
</pre>
<h2>Integrating The First Template Tag</h2>
<p>To integrate the tags we just need to replace some of the words in our HTML markup to the PHP template tags. The first tag we can integrate will be the &#8220;the_author_link();&#8221; tag, here&#8217;s the description from the wordpress codex, located <a href="http://codex.wordpress.org/Template_Tags/the_author_link">HERE</a></p>
<p align="center"><!--adsense#hv_banner--></p>
<p><em>This tag displays a link to the Website for the author of a post. The Website field is set in the user&#8217;s profile (Administration > Profile > Your Profile). The text for the link is the author&#8217;s Profile Display name publicly as field. This tag must be used within The Loop.</em></p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_author/step2.gif" alt="Step2" width="600" height="300" /></p>
<p>Replace the bits of text which uses your name or the &#8220;authors name&#8221; with the &#8220;author-link&#8221; template tag.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_author/step3.gif" alt="Step3" width="600" height="176" /></p>
<p>The markup should now look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;article-author&quot;&gt;&lt;!--ABOUT AUTHOR STARTS--&gt;

&lt;h3&gt;About The Author: &lt;?php the_author_link(); ?&gt;&lt;/h3&gt;

&lt;div id=&quot;author-image&quot;&gt;&lt;!--AUTHOR IMAGE--&gt;
&lt;img src=&quot;http://www.hv-designs.co.uk/site_images/author_images/01.gif&quot; alt=&quot;About The Author&quot; /&gt;
&lt;/div&gt;&lt;!--END AUTHOR IMAGE--&gt;

&lt;div id=&quot;author-text&quot;&gt;&lt;!--AUTHOR TEXT STARTS--&gt;
&lt;p&gt;Hi im Richard Carpenter im a freelance web and graphics designer from England. I am also a regular Blogger, Tutorial Writer, and owner of HV-Designs. You can follow me on twitter HERE. You may also view my portfolio HERE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;?php the_author_link(); ?&gt; has written 254 posts.
&lt;/div&gt;&lt;!--AUTHOR TEXT ENDS--&gt;

&lt;/div&gt;&lt;!--ABOUT AUTHOR ENDS--&gt;
</pre>
<h2>Author Images</h2>
<p>If your the only author on your blog you can add your 80px X 80px image using the normal method, just linking to the image from one of your folders within your site directory. If you have multiple authors you can use the &#8220;author-id&#8221; tag to display the image. Each author on your blog providing you&#8217;ve setup the author in the wordpress users panel is assigned a unique ID. You can find out the ID by hovering over a author link in the edit posts area.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_author/step4.gif" alt="Step4" width="600" height="159" /></p>
<p>Once you&#8217;ve found out the unique ID label the image as the ID, so my unique ID is &#8220;1&#8243; so id rename my image &#8220;1.png&#8221; or &#8220;1.gif&#8221; place the image in a folder on your server. We then add the &#8220;author-id&#8221; template tag where the name of the image would be. The HTML looks like this</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;author-image&quot;&gt;&lt;!--AUTHOR IMAGE--&gt;
&lt;img src=&quot;http://www.hv-designs.co.uk/site_images/author_images/&lt;?php the_author_ID();?&gt;.gif&quot; alt=&quot;About The Author&quot; /&gt;
&lt;/div&gt;&lt;!--END AUTHOR IMAGE--&gt;
</pre>
<h2>Author Description</h2>
<p>Inside the author-text DIV we need to delete the text and the paragraph tags then replace with the &#8220;author-description&#8221; tag. You then need to fill in the biography part under users within wordpress with some author text.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_author/step5.gif" alt="Step5" width="600" height="137" /></p>
<p>The HTML looks like this</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;author-text&quot;&gt;&lt;!--AUTHOR TEXT STARTS--&gt;
&lt;?php the_author_description();?&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;?php the_author_link(); ?&gt; has written 254 posts.
&lt;/div&gt;&lt;!--AUTHOR TEXT ENDS--&gt;
</pre>
<h2>Optional Tags</h2>
<p>On my about author section i have also got abit of text which says &#8220;php the_author_link();&#8221; has written 254 posts. Where 254 is we can add in another template tag so this number updates every time the author posts. The template tag we use for this is the &#8220;author-posts&#8221; tag.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p><em>Displays the total number of posts an author has published. Drafts and private posts aren&#8217;t counted. This tag must be used within The Loop. </em> More info <a href="http://codex.wordpress.org/Template_Tags/the_author_posts"> HERE</a></p>
<p>The HTML looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;author-text&quot;&gt;&lt;!--AUTHOR TEXT STARTS--&gt;
&lt;p&gt;Hi im Richard Carpenter im a freelance web and graphics designer from England. I am also a regular Blogger, Tutorial Writer, and owner of HV-Designs. You can follow me on twitter HERE. You may also view my portfolio HERE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;?php the_author_link(); ?&gt; has written &lt;?php the_author_posts(); ?&gt; posts.
&lt;/div&gt;&lt;!--AUTHOR TEXT ENDS--&gt;
</pre>
<h2>The Whole Code</h2>
<p>So finally our about author code looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;article-author&quot;&gt;&lt;!--ABOUT AUTHOR STARTS--&gt;

&lt;h3&gt;About The Author: &lt;?php the_author_link(); ?&gt;&lt;/h3&gt;

&lt;div id=&quot;author-image&quot;&gt;&lt;!--AUTHOR IMAGE--&gt;
&lt;img src=&quot;http://www.hv-designs.co.uk/site_images/author_images/&lt;?php the_author_ID();?&gt;.gif&quot; alt=&quot;About The Author&quot; /&gt;
&lt;/div&gt;&lt;!--END AUTHOR IMAGE--&gt;

&lt;div id=&quot;author-text&quot;&gt;&lt;!--AUTHOR TEXT STARTS--&gt;
&lt;?php the_author_description();?&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;?php the_author_link(); ?&gt; has written &lt;?php the_author_posts(); ?&gt; posts.
&lt;/div&gt;&lt;!--AUTHOR TEXT ENDS--&gt;

&lt;/div&gt;&lt;!--ABOUT AUTHOR ENDS--&gt;
</pre>
<p>and that concludes this tutorial.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/08/13/about-the-author/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Widgetizing WordPress</title>
		<link>http://www.hv-designs.co.uk/2009/06/28/widgetizing-wordpress/</link>
		<comments>http://www.hv-designs.co.uk/2009/06/28/widgetizing-wordpress/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 07:56:31 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1463</guid>
		<description><![CDATA[Widgetizing your wordpress theme sounds harder than it actually is. In this tutorial il show you how. What Are WordPress Widgets WordPress Widgets (WPW) is like a plugin, but designed to provide a simple way to arrange the various elements of your sidebar content (known as &#8220;widgets&#8221;) without having to change any code. Taken from [...]]]></description>
			<content:encoded><![CDATA[<p>Widgetizing your wordpress theme sounds harder than it actually is. In this tutorial il show you how.</p>
<p><span id="more-1463"></span></p>
<h2>What Are WordPress Widgets</h2>
<p>WordPress Widgets (WPW) is like a plugin, but designed to provide a simple way to arrange the various elements of your sidebar content (known as &#8220;widgets&#8221;) without having to change any code. </p>
<p><em><strong><a href="http://codex.wordpress.org/Plugins/WordPress_Widgets">Taken from the wordpress codex</a></strong></em></p>
<h2>Widget Friendly HTML</h2>
<p>When designing your wordpress theme theres a certain way you should concider coding your sidebar or part of the sidebar you want to widgetize. The best way is to use a simple list markup. Take the example below for instance.</p>
<p align="center"><!--adsense#hv_banner--></p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;sidebar-widget&quot;&gt;&lt;!--SIDEBAR WIDGET STARTS--&gt;
&lt;h3&gt;Widget Title&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;item #1&quot; &gt;Item #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;item #1&quot; &gt;Item #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;item #1&quot; &gt;Item #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;item #1&quot; &gt;Item #1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;&quot; title=&quot;item #1&quot; &gt;Item #1&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--SIDEBAR WIDGET ENDS--&gt;
</pre>
<p>In the code above we have a simple class of &#8220;sidebar-widget&#8221; inside our class we have a simple unordered list and our list items. This is an ideal markup for a wordpress widget.</p>
<h2>Registering Our Sidebar</h2>
<p>Now we have our ideal widget ready HTML code we&#8217;ve go to register our sidebar in our &#8220;functions.php&#8221; file. Open up your file in your code editor then add the code below.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' =&gt; 'Right Sidebar',
'before_widget' =&gt; '&lt;div class=&quot;sidebar-box&quot;&gt;&lt;!--SIDEBAR WIDGET STARTS--&gt;',
'after_widget' =&gt; '&lt;/div&gt;&lt;!--WIDGET BOX ENDS--&gt;',
'before_title' =&gt; '&lt;h3&gt;',
'after_title' =&gt; '&lt;/h3&gt;',
));
}
?&gt;
</pre>
<p>Let me explain the code above in abit more detail. There are 5 parameters you need to set, the first one is &#8220;name&#8221; which will be the name of your widget area, when you add the name it will appear in the widget pallette.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_widgets/step1.gif" alt="Wordpress Widget" width="600" height="300" /></p>
<p>The second parameter is &#8220;before_widget&#8221; in this part you need to put the start of your widget, which in our case is our div class &#8220;sidebar-widget&#8221;. The third parameter is &#8220;after_widget&#8221; this will be the end of our widget, in the space we need to put our ending div.</p>
<p>The last two parameters we need to input are &#8220;before_title&#8221; and &#8220;after_title&#8221;, if you look in our simple HTML list we have a widget title wrapped in a &#8220;H3&#8243; tag.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_widgets/step2.gif" alt="Wordpress Widget Wireframe" width="600" height="529" /></p>
<h2>Adding The Widget Into The Widget Area</h2>
<p>You can have a widget any where you see fit, but for the widget to work you first need to add a couple lines of PHP into the area of your theme where you want the widgets to appear. The code looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(&quot;Right Sidebar&quot;) ) : ?&gt;
&lt;?php endif; ?&gt;
</pre>
<p>Notice in the code above we have our &#8220;right sidebar name&#8221; if you were to have more than one widget area on your theme you can easily define what goes in what widget area and where. To add a second widget area you need add another snippet of widget code like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' =&gt; 'Left Sidebar',
'before_widget' =&gt; '&lt;div class=&quot;LEFT-sidebar-box&quot;&gt;',
'after_widget' =&gt; '&lt;/div&gt;',
'before_title' =&gt; '&lt;h3&gt;',
'after_title' =&gt; '&lt;/h3&gt;',
));
}
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' =&gt; 'Right Sidebar',
'before_widget' =&gt; '&lt;div class=&quot;RIGHT-sidebar-box&quot;&gt;',
'after_widget' =&gt; '&lt;/div&gt;',
'before_title' =&gt; '&lt;h3&gt;',
'after_title' =&gt; '&lt;/h3&gt;',
));
}
?&gt;
</pre>
<p>Once you&#8217;ve inserted your widget code into the area you want it, upload your files and give it a whirl, just dont forget to style your HTML in your stylesheet. Thats it all done, any questions dont hesitate to ask.</p>
<p align="center"><!--adsense#hv_banner--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/06/28/widgetizing-wordpress/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Xampp &amp; WordPress</title>
		<link>http://www.hv-designs.co.uk/2009/04/27/xampp-wordpress/</link>
		<comments>http://www.hv-designs.co.uk/2009/04/27/xampp-wordpress/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 09:44:25 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Screencasts]]></category>
		<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1262</guid>
		<description><![CDATA[Good evening everybody today il be doing a quick tutorial on install wordpress to use with XAMPP. New Screencast Written Tutorial When developing websites or wordpress themes i always use xampp as it makes life so much easier. Basically the program allows you to use your computer as a server, saving you time &#38; bandwith [...]]]></description>
			<content:encoded><![CDATA[<p>Good evening everybody today il be doing a quick tutorial on install wordpress to use with XAMPP.</p>
<p><span id="more-1262"></span><br />
<span style="color: #ff00ff;"><strong>New Screencast</strong></span></p>
<p><object width="600" height="512" data="http://vimeo.com/moogaloop.swf?clip_id=4355557&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=4355557&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=ff0179&amp;fullscreen=1" /></object></p>
<p><span style="color: #ff00ff;"><strong>Written Tutorial</strong></span></p>
<p>When developing websites or wordpress themes i always use xampp as it makes life so much easier. Basically the program allows you to use your computer as a server, saving you time &amp; bandwith uploading to servers online. Firstly your going to need xampp and a fresh copy of wordpress, you can get wordpress from wordpress.org and xampp from apachefriends.org. Once you&#8217;ve downloaded both, extract wordpress to a folder on your desktop and install xampp. After xampp has installed open up your hard drive and locate the xampp folder, inside the xampp folder there should be a folder called &#8220;htdocs&#8221;.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/xampp/step1.gif" alt="Step1" width="600" height="488" /></p>
<p>The &#8220;htdocs&#8221; folder is where you&#8217;ll place your wordpress installation, website ,script etc&#8230; Copy your wordpress folder into the htdocs folder make sure the wordpress folder aint a wordpress folder within a wordpress folder. The contents of the wordpress folder should be on the next level. Open your wordpress folder and rename the file &#8220;wp-config-sample.php&#8221; to &#8220;wp-config.php&#8221;. Open the &#8220;wp-config.php&#8221; file you should be greeted with some PHP, the only chunk of code you need to edit are listed on the image below.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p><img src="http://www.hv-designs.co.uk/tutorials/xampp/step2.gif" alt="Step2" width="561" height="318" /></p>
<p>You need to enter a database name, username and password. Make sure you remember them, save your file then start up xampp, when you load xampp you&#8217;ll be greeted with a box like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/xampp/step3.gif" alt="Step3" width="488" height="488" /></p>
<p>The only two functions you need running are the first two. &#8220;apache &amp; mysql&#8221;, press start on the two services. Your computer is now running as a server using the &#8220;htdocs&#8221; folder as your main server directory. Open your web browser and type &#8220;http://localhost&#8221;.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/xampp/step4.gif" alt="Step4" width="368" height="74" /></p>
<p>You should get a big orange website come up called xampp, in the sidebar under tools click &#8220;phpmyadmin&#8221;. In phpmyadmin you need to create a new database, the database has to be the same as what ever you put in your wordpress config file.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/xampp/step5.gif" alt="Step5" width="449" height="129" /></p>
<p>Once the database has been created click the privilages tab and create a new user. Make sure the username and password are the same as your wordpress config file. Point your browser to &#8220;http://localhost/wordpress&#8221; you should get the wordpress installation page, enter your blog title and e-mail address. Take note of the username and password that comes up on the next screen its wise to change the password to something more rememberable. Your wordpress installation is complete. You can now start adding your themes into the normal theme directory as you would if you were on a server online. You can also look at any offline webpages you might have, just create a folder called &#8220;what ever&#8221; inside the &#8220;htdocs&#8221; folder, place your index.html file inside the &#8220;what ever&#8221; folder. Point your browser to &#8220;http://localhost/what ever folder/index.html.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p>Many thanks for reading, dont forget to subscribe via rss and twitter, your support is much appreciated. See you soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/04/27/xampp-wordpress/feed/</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>BLOOpress WordPress Theme</title>
		<link>http://www.hv-designs.co.uk/2009/04/24/bloopress-wordpress-theme/</link>
		<comments>http://www.hv-designs.co.uk/2009/04/24/bloopress-wordpress-theme/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 18:07:00 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1258</guid>
		<description><![CDATA[Hello welcome to part 3 of the BLOOpress wordpress theme. Today we&#8217;ll be converting our CSS template into a working wordpress theme. PREPARATION Before we go ahead and start ripping away at PHP code we need to do abit of preparation work. The very first thing to do is download a program called &#8220;XAMPP&#8221;, this [...]]]></description>
			<content:encoded><![CDATA[<p>Hello welcome to part 3 of the BLOOpress wordpress theme. Today we&#8217;ll be converting our CSS template into a working wordpress theme.</p>
<p><span id="more-1258"></span></p>
<p><strong>PREPARATION</strong></p>
<p>Before we go ahead and start ripping away at PHP code we need to do abit of preparation work. The very first thing to do is download a program called &#8220;XAMPP&#8221;, this program will allow you to use your P.C as a server. I find its the best way to develop a website as you dont need to be connected to the internet, neither do you use any bandwidth uploading and editing files. You can use your own server if you wish. Il be using XAMPP for this tutorial so assuming you have XAMPP installed and setup to run wordpress, download the &#8220;starkers theme&#8221; by elliot jay stocks. Place your starkers theme inside your wordpress theme&#8217;s directory, then rename it too &#8220;BLOOpress Theme&#8221;. Delete the folder &#8220;style&#8221; and its contents as they arn&#8217;t needed. Create a new folder called &#8220;images&#8221; inside your themes folder, then copy all your image files from your CSS template then paste them inside the images folder in your themes folder.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step1.gif" alt="Step1" width="600" height="393" /></p>
<p>Open up the &#8220;style.CSS&#8221; file from within the theme directory, you should be presented with some code which looks like this.</p>
<pre class="brush: css; title: ; notranslate">
/*
Theme Name: Starkers
Theme URI: http://elliotjaystocks.com
Description: The totally nude WordPress theme. Phwoar! (Based on the famous &lt;a href=&quot;http://binarybonsai.com/kubrick/&quot;&gt;Kubrick&lt;/a&gt; by &lt;a href=&quot;http://binarybonsai.com/&quot;&gt;Michael Heilemann&lt;/a&gt;)
Version: 2 (WP2.6.2)
Author: Elliot Jay Stocks
Author URI: http://elliotjaystocks.com
Tags: starkers, naked, clean, basic
*/

@import &quot;style/css/reset.css&quot;;
@import &quot;style/css/typography.css&quot;;
@import &quot;style/css/layout.css&quot;;
</pre>
<p>The first chunk of code is very important,its not just abit of code telling you who designed the theme. Its actually what makes the theme recognisable to wordpress. We dont actually need all of the code, i like to use a nice stripped back look. Go ahead and change the details to suit your theme. You can also remove the 3 imported style sheets as we&#8217;ve already deleted them. My code now looks like this.</p>
<pre class="brush: css; title: ; notranslate">
/*
Theme Name: BLOOpress
Theme URI: http://www.bloopress.co.uk
Description: Just another wordpress theme by hv-designs
Version: 1 (WP2.6.2)
Author: Richard Carpenter
*/
</pre>
<p>After you&#8217;ve edited the code we need to copy all our CSS styles from our CSS template&#8217;s style sheet and paste them inside the theme&#8217;s &#8220;style.CSS&#8221; file. Save your themes&#8217;s style sheet and activate the theme in wordpress, view your theme in your browser, you should be presented with something like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step2.gif" alt="Step2" width="600" height="583" /></p>
<p><strong>MODIFYING THE HEADER.PHP FILE</strong></p>
<p>Open up header.PHP from the theme directory, you should be presented with a bunch of code similar to an ordinary HTML file only with a bit of PHP thrown in. The first chunk of code we can edit is the code between the TITLE tag.</p>
<pre class="brush: php; title: ; notranslate">
&lt;title&gt;
&lt;?php if (is_home()) { echo bloginfo('name');
} elseif (is_404()) {
echo '404 Not Found';
} elseif (is_category()) {
echo 'Category:'; wp_title('');
} elseif (is_search()) {
echo 'Search Results';
} elseif ( is_day() || is_month() || is_year() ) {
echo 'Archives:'; wp_title('');
} else {
echo wp_title('');
}
?&gt;
&lt;/title&gt;
</pre>
<p>You can remove all the PHP from within the TITLE tag, replace the code with a simple title for your theme.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;title&gt;BLOOpress &quot;just another wordpress blog&quot;&lt;/title&gt;
</pre>
<p>The next thing we need to do is locate this chunk of text right at the bottom of the PHP file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;h1&gt;&lt;a href=&quot;&lt;?php echo get_option('home'); ?&gt;/&quot;&gt;&lt;?php bloginfo('name'); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;?php bloginfo('description'); ?&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;?php wp_list_pages('title_li='); ?&gt;
&lt;/ul&gt;
</pre>
<p>All of this code can be removed as its not needed. The last tag at the bottom of the PHP file should be an opening &#8220;BODY TAG&#8221;. All the code we&#8217;ll be adding in a moment will go underneath the &#8220;body&#8221; tag. Open up your CSS template, locate all the code to do with the header, so we need to select our opening container DIV, the top nav, the header, the search box, the logo and the second nav.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step3.gif" alt="Step3" width="600" height="373" /></p>
<p>Copy all the hightlighted code and paste into your header.PHP file underneath the body tag. Once you&#8217;ve pasted the code save your .PHP file and check the theme in your browser, heres mine.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step4.gif" alt="Step4" width="600" height="329" /></p>
<p>When you check your theme in your browser take note of the missing images, you should have two images that dont load up, the logo and the search button. The reason why they dont show up is because direct linking to images within the wordpress themes folder doesnt work its blocked by the htaccess file. The only way to get the images to load up is to either place the files in a directory outside the wordpress installation OR use some PHP code which looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/title.png&quot; border=&quot;0&quot; alt=&quot;BLOOpress&quot; /&gt;
</pre>
<p>So in the header.PHP file inside the title DIV, you need to change the img src to the code above. It should looks something like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;title&quot;&gt;&lt;!--title image start--&gt;
&lt;a href=&quot;http://www.hv-designs.co.uk&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/title.png&quot; border=&quot;0&quot; alt=&quot;BLOOpress&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;!--title image end--&gt;
</pre>
<p>As for the search form we need to get rid of it and replace with a wordpress search form. The one we put on was just an example. Remove the example search fields from within the &#8220;search-from&#8221; DIV.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;search-form&quot;&gt;&lt;!--search form starts--&gt;

&lt;/div&gt;&lt;!--search form ends--&gt;
</pre>
<p>If you open up the &#8220;index.PHP&#8221; file and locate the following code.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step5.gif" alt="Step5" width="522" height="273" /></p>
<p>The code highlighted in the image above is a PHP include, which basically displays a PHP file within the PHP file but the file is seperated from the rest of the file&#8230;. hope that makes sense. Copy the code from the index.PHP file and paste it between our &#8220;search-form&#8221; DIV.</p>
<p align="center"><!--adsense#hv_banner--></p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;search-form&quot;&gt;&lt;!--search form starts--&gt;
&lt;?php include (TEMPLATEPATH . &quot;/searchform.php&quot;); ?&gt;
&lt;/div&gt;&lt;!--search form ends--&gt;
</pre>
<p>Now we need to alter our PHP file &#8220;searchform.php&#8221;. Go ahead and open up the file in dreamweaver. You should be presented with a simple form structure some what similar to the one we had before.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;
&lt;label class=&quot;hidden&quot; for=&quot;s&quot;&gt;&lt;?php _e('Search for:'); ?&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;
</pre>
<p>The first thing we can do is remove line 2, the label class.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;

&lt;input type=&quot;text&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;
</pre>
<p>Now we can start adding our personnal touches, in the first input type remove the bit of php from within the value attribute and replace with &#8220;Search&#8230;&#8221;. Then on the 2nd input type change the &#8220;value&#8221; attribute from search to &#8220;go!&#8221;.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;

&lt;input type=&quot;text&quot; value=&quot;Search...&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Go!&quot; /&gt;
&lt;/form&gt;
</pre>
<p>Now add your classes, remember in our CSS template we had two styles one for the button and one for the text field.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;

&lt;input type=&quot;text&quot; value=&quot;Search...&quot; name=&quot;s&quot; id=&quot;s&quot; class=&quot;search-field&quot;/&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; class=&quot;search-button&quot; value=&quot;Go!&quot; /&gt;
&lt;/form&gt;
</pre>
<p>We now need to replace our submit button with our picture button to do that we need change our 2nd input type from type to name. Then add another attribute called &#8220;type=image&#8221;. Next to the &#8220;type=image&#8221; attribute we need to add our image SRC.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;

&lt;input type=&quot;text&quot; value=&quot;Search...&quot; name=&quot;s&quot; id=&quot;s&quot; class=&quot;search-field&quot;/&gt;
&lt;input name=&quot;submit&quot; type=&quot;image&quot; src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/submit_bg.png&quot; alt=&quot;Submit Form&quot; id=&quot;searchsubmit&quot; class=&quot;search-button&quot; value=&quot;Go!&quot; /&gt;
&lt;/form&gt;
</pre>
<p>Save your header.PHP file and searchform.PHP file and test your theme in your browser. The search should be fully functional and look the same as our CSS template. Now you need to edit the links in the top navigation to point to where you need to.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;nav1&quot;&gt;&lt;!--nav1 starts--&gt;
&lt;ul class=&quot;nav1-links&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hv-designs.co.uk&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hv-designs.co.uk&quot;&gt;Sitemap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.hv-designs.co.uk&quot;&gt;Contact Me&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--nav 1 ends--&gt;
</pre>
<p>Our second navigation is for our wordpress pages which will involve some PHP but if you want to you can add static links to other pages around the web, just use a setup similar to nav#1. To make the 2nd navigation use dynamic wordpress pages you first need to clear all the text we stuck in there when we coded our CSS template. Just leave one empty list.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;nav2&quot;&gt;&lt;!--nav2 starts--&gt;
&lt;ul class=&quot;nav1-links&quot;&gt;
&lt;li&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--nav2 ends--&gt;
</pre>
<p>We now need to use a chunk of PHP code to display our pages, the PHP code will get the pages from within wordpress and display each page as our CSS template did. Inbetween the LI tag add this code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;nav2&quot;&gt;&lt;!--nav2 starts--&gt;
&lt;ul class=&quot;nav1-links&quot;&gt;
&lt;li&gt;&lt;?php wp_list_pages('title_li='); ?&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;&lt;!--nav2 ends--&gt;
</pre>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step6.gif" alt="Step6" width="600" height="333" /></p>
<p>Thats it the header.PHP file is complete.</p>
<p><strong>MODIFYING THE INDEX.PHP FILE</strong></p>
<p>Our next file to modfiy is the index.PHP file, this file relates to the main page of the document, its the first page everyone see&#8217;s upon entering your blog. The bit we&#8217;ll be modifying now is the post loop, to get more of an idea on how the code works and how it relates to live post check the image below.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step7.gif" alt="Step7" width="600" height="413" /></p>
<p>The code above is the part we&#8217;ll be editing now, like i said its known as the wordpress loop, everytime you make a post the same code is used over and over. Open up your CSS template and locate our example post. Our post started with an opening DIV of left-content, so copy the first DIV of left-content and paste it under the PHP code &#8220;get header&#8221;. Our post starts with &#8220;post-box&#8221; paste our class of post-box underneath the PHP code &#8220;have posts&#8221;. Add your left-content ending DIV right at the bottom of the file above the &#8220;get sidebar&#8221; PHP code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : ?&gt;

&lt;?php while (have_posts()) : the_post(); ?&gt;        

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;
</pre>
<p>Underneath our post loop add the ending DIV for left-content.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/p&gt;

&lt;?php the_content('Read the rest of this entry &amp;amp;amp;raquo;'); ?&gt;

&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments &amp;amp;amp;#187;', '1 Comment &amp;amp;amp;#187;', '% Comments &amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>The next part generally involves moving chunks of code around, copy and pasting our DIV&#8217;s from our CSS template over to our post loop. We&#8217;ll start from the top and work our way down. There is a floating ending DIV above our ending left-content DIV, this needs to be moved up to the begining of our post loop.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step8.gif" alt="Step8" width="580" height="328" /></p>
<p>In the loop there is a H2 tag, which is our post title, change the H2 tag to a H1 tag. Then wrap the H1 tag in our post title class from our CSS template. Above the post-title class add our post-thumb class.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : ?&gt;

&lt;?php while (have_posts()) : the_post(); ?&gt;        

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;/div&gt;

&lt;div class=&quot;post-thumb&quot;&gt;&lt;!--wordpress post thumbnail starts--&gt;
&lt;img src=&quot;images/example-thumbnail.gif&quot; alt=&quot;EXAMPLE THUMBNAIL&quot; /&gt;
&lt;/div&gt;&lt;!--wordpress post thumbnail ends--&gt;

&lt;div class=&quot;post-title&quot;&gt;&lt;!--wordpress post title starts--&gt;
&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;&lt;!--wordpress post title ends--&gt;
</pre>
<p>Underneath our post-title class we need to add our post-content class, inside the post-content class you need to add the PHP code for our wordpress content, you can refer back to the post loop image i created ealier.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-content&quot;&gt; &lt;!--wordpress content starts--&gt;
&lt;?php the_content('Read the rest of this entry &amp;amp;amp;raquo;'); ?&gt;
&lt;/div&gt;&lt;!--wordpress content ends--&gt;
</pre>
<p>Underneath our post-content class we need to add our ending content box DIV then add our footer class. Inside our footer class we need to add the remaining code which is the PHP code for the author, time &#038; date and number of comments. Try and keep the whole thing nice and tidy if you can. The new post loop looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;/div&gt;

&lt;div class=&quot;post-thumb&quot;&gt;&lt;!--wordpress post thumbnail starts--&gt;
&lt;img src=&quot;images/example-thumbnail.gif&quot; alt=&quot;EXAMPLE THUMBNAIL&quot; /&gt;
&lt;/div&gt;&lt;!--wordpress post thumbnail ends--&gt;

&lt;div class=&quot;post-title&quot;&gt;&lt;!--wordpress post title starts--&gt;
&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;/div&gt;&lt;!--wordpress post title ends--&gt;

&lt;div class=&quot;post-content&quot;&gt; &lt;!--wordpress content starts--&gt;
&lt;?php the_content('Read the rest of this entry &amp;amp;amp;raquo;'); ?&gt;
&lt;/div&gt;&lt;!--wordpress content ends--&gt;

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt; 

&lt;div class=&quot;post-footer&quot;&gt;&lt;!--wordpress posts footer--&gt;
&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt; |&lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments &amp;#187;', '1 Comment &amp;#187;', '% Comments &amp;#187;'); ?&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--wordpress post footer ends--&gt;
</pre>
<p>Save your file and test your theme in your browser, mine looks like this. The posts display how we want them to, ignore all the rest, it will loook quite messy still as were yet to add code to the other files.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step9.gif" alt="Step9" width="600" height="409" /></p>
<p>Thats it for our index.PHP file for now, we&#8217;ll come back later and sort out our thumbnail for our posts, as at the minute it still contains our example image, we might also have to do some minor fixes, but we&#8217;ll see how it goes.</p>
<p><strong>MODIFYING THE SIDEBAR.PHP FILE</strong></p>
<p>Once you&#8217;ve opened up your sidebar.PHP file highlight everything from LINE 4 to LINE 43, and hit the delete key as the code isn&#8217;t needed.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step10.gif" alt="Step10" width="600" height="446" /></p>
<p>Once you&#8217;ve done that copy and paste over all your sidebar code from the CSS template. </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php 	/* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?&gt;

&lt;div id=&quot;right-content&quot;&gt;&lt;!--sidebar starts--&gt;

&lt;div id=&quot;stay-connected&quot;&gt;&lt;!--stay connected box starts--&gt;
&lt;h1&gt;Stay Connected...&lt;/h1&gt;

&lt;div class=&quot;sc-icon&quot;&gt;&lt;!--RSS icon--&gt;
&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/rss_icon.png&quot; border=&quot;0&quot; alt=&quot;RSS&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;!--RSS icon ends--&gt;

&lt;div class=&quot;icon-text&quot;&gt;&lt;!--RSS icon text--&gt;
&lt;p class=&quot;subscribe&quot;&gt;Subscribe via RSS&lt;/p&gt;
&lt;p class=&quot;subscribe2&quot;&gt;Updates in your reader&lt;/p&gt;
&lt;/div&gt;&lt;!--RSS icon text ends--&gt;

&lt;div class=&quot;sc-icon&quot;&gt;&lt;!--TWITTER icon--&gt;
&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/twitter_icon.png&quot; border=&quot;0&quot; alt=&quot;TWITTER&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;!--TWITTER icon ends--&gt;

&lt;div class=&quot;icon-text&quot;&gt;&lt;!--TWITTER icon text--&gt;
&lt;p class=&quot;subscribe&quot;&gt;Subscribe via twitter&lt;/p&gt;
&lt;p class=&quot;subscribe2&quot;&gt;Updates on your twitter&lt;/p&gt;
&lt;/div&gt;&lt;!--TWITTER icon text ends--&gt;

&lt;div class=&quot;sc-icon&quot;&gt;&lt;!--EMAIL icon--&gt;
&lt;a href=&quot;#&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('template_directory'); ?&gt;/images/mail_icon.png&quot; border=&quot;0&quot; alt=&quot;EMAIL&quot; /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;!--EMAIL icon ends--&gt;

&lt;div class=&quot;icon-text&quot;&gt;&lt;!--EMAIL icon text--&gt;
&lt;p class=&quot;subscribe&quot;&gt;Subscribe via email&lt;/p&gt;
&lt;p class=&quot;subscribe2&quot;&gt;Updates in your mailbox&lt;/p&gt;
&lt;/div&gt;&lt;!--EMAIL icon text ends--&gt;

&lt;/div&gt;&lt;!--stay connected box ends--&gt;   

&lt;ul&gt;

&lt;?php wp_list_pages('title_li=&lt;h2&gt;Pages&lt;/h2&gt;' ); ?&gt;

&lt;li&gt;&lt;h2&gt;Archives&lt;/h2&gt;
&lt;ul&gt;
&lt;?php wp_get_archives('type=monthly'); ?&gt;
&lt;/ul&gt;
&lt;/li&gt;

&lt;?php wp_list_categories('show_count=1&amp;amp;amp;title_li=&lt;h2&gt;Categories&lt;/h2&gt;'); ?&gt;

&lt;?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?&gt;
&lt;?php wp_list_bookmarks(); ?&gt;

&lt;li&gt;
&lt;h2&gt;Meta&lt;/h2&gt;
&lt;ul&gt;
&lt;?php wp_register(); ?&gt;
&lt;li&gt;&lt;?php wp_loginout(); ?&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://validator.w3.org/check/referer&quot; title=&quot;This page validates as XHTML 1.0 Transitional&quot;&gt;Valid &lt;abbr title=&quot;eXtensible HyperText Markup Language&quot;&gt;XHTML&lt;/abbr&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gmpg.org/xfn/&quot;&gt;&lt;abbr title=&quot;XHTML Friends Network&quot;&gt;XFN&lt;/abbr&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://wordpress.org/&quot; title=&quot;Powered by WordPress, state-of-the-art semantic personal publishing platform.&quot;&gt;WordPress&lt;/a&gt;&lt;/li&gt;
&lt;?php wp_meta(); ?&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;?php } ?&gt;

&lt;?php endif; ?&gt;
&lt;/ul&gt;

&lt;/div&gt;&lt;!--sidebar ends--&gt;

&lt;/div&gt;&lt;!--container ends--&gt;
</pre>
<p>Once you&#8217;ve pasted in your code you&#8217;ll need update your image paths on your icons with PHP, just like we did our blog title image and search submit button. You&#8217;ll also need to link your icons to the relivant source, I.E twitter, rss etc&#8230; Save your sidebar.PHP file and check your theme in your browser. </p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step11.gif" alt="Step11" width="600" height="382" /></p>
<p><strong>MODIFYING THE FOOTER.PHP FILE</strong></p>
<p>Open up footer.PHP, select all the code and hit the delete key. Open your CSS template and copy all the code for the footer.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step12.gif" alt="Step12" width="600" height="171" /></p>
<p>Paste all your footer code into your footer.PHP file. Save the file then test your theme inside your browser. We&#8217;ve now modified some of the main files for our theme, its now time to make a start on some of the other files.</p>
<p><strong>MODIFYING THE SEARCH.PHP FILE</strong></p>
<p>The search.PHP file is the file which is called when a search is made, the search.PHP file provides you with the search results, the file is structure pretty much the same as the index.PHP file, which will make things easier to edit. Open up your search.PHP file, underneath the first line of PHP code (get header) add your opening DIV of left-content.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt;
</pre>
<p>Scroll down right to the bottom of your file, just above the get sidebar PHP code add your ending left-content DIV.</p>
<pre class="brush: php; title: ; notranslate">
&lt;/div&gt;&lt;!--left content ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>Head over to your index.PHP file, highlight and copy your post loop to the clipboard.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step13.gif" alt="Step13" width="596" height="367" /></p>
<p>Highlight the post loop inside the search.PHP file and hit delete.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step14.gif" alt="Step14" width="600" height="286" /></p>
<p>Paste in your code from the index.PHP file. Save your work and test out the search function on your theme, providing you have some posts you should see your search results display somet what similar to the index.PHP file.</p>
<p><strong>MODIFYING THE PAGE.PHP FILE</strong></p>
<p>The page.PHP file relates to actual pages that you have on your blog. The pages will also be displayed the same as the index.PHP file but instead of being loads of seperate boxes imagine it as one big post box. Inside your page.PHP file you need to add again the left-content DIV, place the opening DIV underneath the first big PHP (get header) and the ending DIV above the get sidebar bit of PHP code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
&lt;?php the_content('&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;raquo;&lt;/p&gt;'); ?&gt;
&lt;?php wp_link_pages(array('before' =&gt; '&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ', 'after' =&gt; '&lt;/p&gt;', 'next_or_number' =&gt; 'number')); ?&gt;
&lt;/div&gt;
&lt;?php endwhile; endif; ?&gt;
&lt;?php edit_post_link('Edit this entry.', '&lt;p&gt;', '&lt;/p&gt;'); ?&gt;

&lt;/div&gt;&lt;!--left content ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>Underneath the DIV CLASS &#8220;post&#8221; you need to add our &#8220;post-box&#8221; class. </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;?php the_content('&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;amp;amp;raquo;&lt;/p&gt;'); ?&gt;
&lt;?php wp_link_pages(array('before' =&gt; '&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ', 'after' =&gt; '&lt;/p&gt;', 'next_or_number' =&gt; 'number')); ?&gt;
&lt;/div&gt;
&lt;?php endwhile; endif; ?&gt;
</pre>
<p>Underneath the PHP endwhile; endif we need to add our closing post-box DIV. Then simply add our post-fooer class. Inbetween our post footer class add the PHP edit_post_link. The page.PHP file should something like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;?php the_content('&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;amp;amp;raquo;&lt;/p&gt;'); ?&gt;
&lt;?php wp_link_pages(array('before' =&gt; '&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; ', 'after' =&gt; '&lt;/p&gt;', 'next_or_number' =&gt; 'number')); ?&gt;
&lt;/div&gt;
&lt;?php endwhile; endif; ?&gt;	

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt; 

&lt;div class=&quot;post-footer&quot;&gt;&lt;!--wordpress posts footer--&gt;
&lt;?php edit_post_link('Edit this entry.', '&lt;p&gt;', '&lt;/p&gt;'); ?&gt;
&lt;/div&gt;&lt;!--wordpress post footer ends--&gt;

&lt;/div&gt;&lt;!--left content ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>If you have any pages on your blog, save your work and try them out. </p>
<p><strong>MODIFYING THE ARCHIVE.PHP FILE</strong></p>
<p>The archive page again is styled in pretty much the same way as the index.PHP file. We start by adding our content-left class underneath our get header PHP code, then ending it above the get sidebar PHP code. We then have to locate the post loop, add our post-box class underneath the &#8220;have posts PHP&#8221;.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt;

&lt;?php if (have_posts()) : ?&gt;

&lt;?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?&gt;
&lt;?php /* If this is a category archive */ if (is_category()) { ?&gt;
&lt;h2&gt;Archive for the &amp;#8216;&lt;?php single_cat_title(); ?&gt;&amp;#8217; Category&lt;/h2&gt;
&lt;?php /* If this is a tag archive */ } elseif( is_tag() ) { ?&gt;
&lt;h2&gt;Posts Tagged &amp;#8216;&lt;?php single_tag_title(); ?&gt;&amp;#8217;&lt;/h2&gt;
&lt;?php /* If this is a daily archive */ } elseif (is_day()) { ?&gt;
&lt;h2&gt;Archive for &lt;?php the_time('F jS, Y'); ?&gt;&lt;/h2&gt;
&lt;?php /* If this is a monthly archive */ } elseif (is_month()) { ?&gt;
&lt;h2&gt;Archive for &lt;?php the_time('F, Y'); ?&gt;&lt;/h2&gt;
&lt;?php /* If this is a yearly archive */ } elseif (is_year()) { ?&gt;
&lt;h2&gt;Archive for &lt;?php the_time('Y'); ?&gt;&lt;/h2&gt;
&lt;?php /* If this is an author archive */ } elseif (is_author()) { ?&gt;
&lt;h2&gt;Author Archive&lt;/h2&gt;
&lt;?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) &amp;&amp; !empty($_GET['paged'])) { ?&gt;
&lt;h2&gt;Blog Archives&lt;/h2&gt;
&lt;?php } ?&gt;

&lt;?php while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;
</pre>
<p>Underneath the PHP_the_content tag we need to close our post-box DIV.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;        

&lt;h3 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;?php the_time('l, F jS, Y') ?&gt;&lt;/p&gt;
&lt;?php the_content() ?&gt;

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt;
</pre>
<p>Then underneath our post-box ending DIV we need to start our post-footer class, inside our post footer class we use the META data from the post loop. Then underneath our P tag with the the PHP code for &#8220;the_time&#8221; add a BR tag. Doing this will space out the post abit so it isnt all muggled together.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;        

&lt;h3 id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;?php the_time('l, F jS, Y') ?&gt;&lt;/p&gt;

&lt;br /&gt;

&lt;?php the_content() ?&gt;

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt;

&lt;div class=&quot;post-footer&quot;&gt;&lt;!--wordpress posts footer--&gt;
&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt;  &lt;?php comments_popup_link('No Comments &amp;amp;amp;#187;', '1 Comment &amp;amp;amp;#187;', '% Comments &amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--wordpress post footer ends--&gt;
</pre>
<p><strong>MODIFYING THE SINGE.PHP &#038; COMMENTS.PHP FILE</strong></p>
<p>These two files ive left untill last because they are the most fiddly especially the comments.PHP file. We&#8217;ll start with the sing.PHP file as this wont take too long to do, this file is for out posts, once you click on a post it loads this file. We modify the single.PHP file in the same way we did our other files, we need to add our left content DIV at the top underneath our get header PHP code, then we need to end it at the bottom of the file above the get footer PHP code. If you want the sidebar to be in with the single.PHP file then you need to add the get sidebar PHP tag.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
&lt;/div&gt;&lt;!--left content ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>We&#8217;ll then begin to add our post CSS styles from our style sheet again, this part will be similar to the the page.PHP file we edited earlier. Under the PHP code have posts add our psot-box class then underneath the PHP code the_content add your closing DIV.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;left-content&quot;&gt;&lt;!--left content starts--&gt; 

&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;
&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;

&lt;?php the_content('&lt;p&gt;Read the rest of this entry &amp;raquo;&lt;/p&gt;'); ?&gt;

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt;
</pre>
<p>The single.PHP file is complete, move onto your comments.PHP file. If you take alook at one of your posts, you&#8217;ll see what a mess the comments area is in.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step15.gif" alt="Step15" width="600" height="310" /></p>
<p>The first we can do to tidy it up abit is shorten the big text area and add some spaceing between each form field. We&#8217;ll start with the big text box, scroll right down to the bottom and locate the form field. The part of code you want to look for is&#8230;</p>
<pre class="brush: xml; title: ; notranslate">
&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;
</pre>
<p>Take note of the &#8220;cols attribute&#8221; see how it says 100% we need to change that to 72. So the code now becomes.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;72&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;
</pre>
<p>To align each of the text boxes, underneath each other add opening &#038; closing P Tags either end of the code. After the last P tag add a BR tag.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;author&quot;&gt;Name &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo $comment_author_email; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;2&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;email&quot;&gt;Mail (will not be published) &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
&lt;label for=&quot;url&quot;&gt;Website&lt;/label&gt;&lt;/p&gt;&lt;br /&gt;
</pre>
<p>Your comments area should now look something like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/bloopress/pt3/step16.gif" alt="Step16" width="600" height="319" /></p>
<p>The footer could do with being pushed down alittle, open up your style sheet and add &#8220;margin-top: 40px;&#8221; to the #footer-bg DIV. Now were going to add some styling to our actual comments, your going to need to add new styles to your style sheet but we&#8217;ll try and use the ones all ready made. Add these styles into your style sheet.</p>
<p align="center"><!--adsense#hv_banner--></p>
<pre class="brush: css; title: ; notranslate">
.float-right {
	float:right;
}

ul, ol {
list-style:none;
}
</pre>
<p>Begin to add some of your styles to the comments loop. Im going to style each  comment to look like one of our wordpress posts.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!-- You can start editing here. --&gt;

&lt;?php if ($comments) : ?&gt;
&lt;h3 id=&quot;comments&quot;&gt;&lt;?php comments_number('No Responses', 'One Response', '% Responses' );?&gt; to &amp;amp;amp;#8220;&lt;?php the_title(); ?&gt;&amp;amp;amp;#8221;&lt;/h3&gt;

&lt;ol&gt;

&lt;?php foreach ($comments as $comment) : ?&gt;

&lt;div class=&quot;post-box&quot;&gt;&lt;!--wordpress post content box starts--&gt;

&lt;p &lt;?php echo $oddcomment; ?&gt;id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;
&lt;div class=&quot;float-right&quot;&gt;&lt;?php echo get_avatar( $comment, 72 ); ?&gt;&lt;/div&gt;
&lt;h2&gt;&lt;?php comment_author_link() ?&gt;&lt;/h2&gt;
&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
&lt;br /&gt;
&lt;p&gt;Your comment is awaiting moderation.&lt;/p&gt;
&lt;br /&gt;
&lt;?php endif; ?&gt;
&lt;?php comment_text() ?&gt;
&lt;/p&gt;

&lt;/div&gt;&lt;!--wordpress post content box ends--&gt;
&lt;div class=&quot;post-footer&quot;&gt;&lt;!--wordpress posts footer--&gt;
&lt;p&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('edit','&amp;amp;amp;nbsp;&amp;amp;amp;nbsp;',''); ?&gt;&lt;/p&gt;
&lt;/div&gt;&lt;!--wordpress post footer ends--&gt;
</pre>
<p>Change post-box from post-box to post-box2 and change post-footer to post-footer2. Now paste these styles into your style sheet.</p>
<pre class="brush: css; title: ; notranslate">
.post-box2 {
	background-color: #292929; /*adds a background color to our post box*/
	border: 1px solid #2f2f2f; /*gives our box a 1px border*/
	padding: 10px; /*adss 10px padding all the way around our box*/
	float: left; /*floats our box left inside &quot;left-content div*/
	width: 578px; /*gives our box a width of 580px*/
	margin-top: 10px;
}

.post-footer2 {
	border: 1px solid #0c5b7d; /*adss 10px padding all the way around our box*/
	float: left; /*floats our box left inside &quot;left-content div*/
	width: 578px; /*gives our box a width of 580px*/
	background-image: url(images/post_footer_bg.png); /*adds background image*/
	background-repeat: repeat-x; /*repeats background horizontally*/
	height: 20px; /*gives our class a height of 20px*/
	padding-top: 6px; /*adss 6px padding to the top*/
	padding-right: 10px; /*adds 10 px padding to the right*/
	padding-left: 10px; /*adds 10px padding to the left*/
	margin-bottom: 5px; /*adds a 20px margin between each post*/
}
</pre>
<p>While your in your style sheet you can also paste in these styles.</p>
<pre class="brush: css; title: ; notranslate">
a:link {
	color: #FFFFFF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #FFFFFF;
}
a:hover {
	text-decoration: none;
	color: #0099FF;
}

h1,h2,h3,h4 {
	color: #0c78a8;
}

.post-title h1 a{
	color: #0c78a8; /*h1 tag text color*/
}

.post-box2 p {
	margin: 5px 0 10px;
}

#left-content p{
	margin: 5px 0 10px;
}
</pre>
<p>Should clean some of our bad link colors up and some spacing issues. Now finally re-open your sidebar.PHP file, locate all H2 tags and replace with H4 tags. Re-open your index.PHP file and locate your example thumbnail.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;post-thumb&quot;&gt;&lt;!--wordpress post thumbnail starts--&gt;
&lt;img src=&quot;images/example-thumbnail.gif&quot; alt=&quot;EXAMPLE THUMBNAIL&quot; /&gt;
&lt;/div&gt;&lt;!--wordpress post thumbnail ends--&gt;
</pre>
<p>Delete your exampple thumbnail and replace with this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-thumb&quot;&gt;&lt;!--wordpress post thumbnail starts--&gt;
&lt;a href=&quot;&lt;?php $values = get_post_custom_values(&quot;url&quot;); echo $values[0]; ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
&lt;img src=&quot; &lt;?php $values = get_post_custom_values(&quot;image&quot;); echo $values[0]; ?&gt;&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot; /&gt;&lt;/a&gt;
&lt;/div&gt;&lt;!--wordpress post thumbnail ends--&gt;
</pre>
<p>This will now allow you to insert you thumbnail and link for the thumbnail through the custom fields part within creating a wordpress post. You should now have something you can use for your own website, dont get me wrong this theme isnt 5 stars, but should learn you some basics on getting started with wordpress.</p>
<p>Thats all from me, hope you&#8217;ve enjoy this LONG tutorial. Im sorry some things are abit short and sweet but ive had such little time to get this one out and live. Feel free to ask any questions il be happy to help you in any way i can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/04/24/bloopress-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Seperating Trackbacks &amp; Pingbacks</title>
		<link>http://www.hv-designs.co.uk/2009/04/04/seperating-trackbacks-pingsbacks-in-wordpress/</link>
		<comments>http://www.hv-designs.co.uk/2009/04/04/seperating-trackbacks-pingsbacks-in-wordpress/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 17:34:46 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1218</guid>
		<description><![CDATA[Hello, welcome to another tutorial by hv-designs. Today we&#8217;ll be diving into wordpress again looking at seperating our comments and our trackbacks. Most blogs i visit or have seen dont bother to seperate there comments and tracksbacks, personnally i think it looks better and more orgainised. It can be achived with minium effort and very [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, welcome to another tutorial by hv-designs. Today we&#8217;ll be diving into wordpress again looking at seperating our comments and our trackbacks.</p>
<p><span id="more-1218"></span></p>
<p>Most blogs i visit or have seen dont bother to seperate there comments and tracksbacks, personnally i think it looks better and more orgainised. It can be achived with minium effort and very little code. In todays tutorial il be seperating our trackbacks and comments using the &#8220;mywordpress theme&#8221; tha we previously created a couple of days ago. Open up your comments.php file in dreamweaver or notepad. The file should be located in the theme directory.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step1.gif" alt="Step1" width="370" height="360" /></p>
<p>Once open locate the line &#8220;php foreach $comments as $comment&#8221;.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step2.gif" alt="Step2" width="542" height="319" /></p>
<p>After this line paste this snippet of code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type == 'comment') { ?&gt;
</pre>
<p>Your code should now look like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step3.gif" alt="Step3" width="533" height="235" /></p>
<p>Scroll down and locate the end of comment loop. &#8220;php endforeach; /* end for each comment */&#8221;.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step4.gif" alt="Step4" width="582" height="275" /></p>
<p>Just before the code above we need to end our &#8220;is comment statment&#8221;. Which looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php } /* End of is_comment statement */ ?&gt;
</pre>
<p>The code should look like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step5.gif" alt="Step5" width="546" height="222" /></p>
<p>What does all this code do i here you shout????? Basically the code will seperate all your trackbacks and pingbacks from the main comments loop. This will allow us to add a second comments loop to the comments file to display the trackbacks and pingbacks only.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p>Locate this snippet of code inside your comments.php file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php else : // this is displayed if there are no comments so far ?&gt;
</pre>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step6.gif" alt="Step6" width="577" height="245" /></p>
<p>Just before it add this code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;h3&gt;Trackbacks&lt;/h3&gt;
&lt;ol&gt;
&lt;?php foreach ($comments as $comment) : ?&gt;
&lt;?php $comment_type = get_comment_type(); ?&gt;
&lt;?php if($comment_type != 'comment') { ?&gt;
&lt;li&gt;&lt;?php comment_author_link() ?&gt;&lt;/li&gt;
&lt;?php } ?&gt;
&lt;?php endforeach; ?&gt;
&lt;/ol&gt;
</pre>
<p><img src="http://www.hv-designs.co.uk/tutorials/wp_trackbacks/step7.gif" alt="Step7" width="579" height="312" /></p>
<p>If you are using the &#8220;mywordpress theme&#8221; change the H3 tag from H3 to H1 or H2. Thats it all done, the code above can then be styled as you wish, its not that different from when we styled our comments.php file in the &#8220;my wordpress theme tutorial&#8221;. If you liked this tutorial please subscribe to our twitter and RSS feeds. Thanks for reading, till next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/04/04/seperating-trackbacks-pingsbacks-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>PSD to CSS to WordPress Pt.3</title>
		<link>http://www.hv-designs.co.uk/2009/03/31/psd-to-css-to-wordpress-pt3/</link>
		<comments>http://www.hv-designs.co.uk/2009/03/31/psd-to-css-to-wordpress-pt3/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 08:41:11 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/?p=1208</guid>
		<description><![CDATA[Hello welcome to part 3 of the PSD to CSS to WORDPRESS tutoral, in this part of the tutorial we&#8217;ll be converting our CSS template into a working wordpress theme. You can download the theme for free using the button below you can also down all 3 tutorials in PDF format. DOWNLOAD ALL 3 TUTORIALS [...]]]></description>
			<content:encoded><![CDATA[<p>Hello welcome to part 3 of the PSD to CSS to WORDPRESS tutoral, in this part of the tutorial we&#8217;ll be converting our CSS template into a working wordpress theme. You can download the theme for free using the button below you can also down all 3 tutorials in <a href="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/tutorial_PDF.zip">PDF format</a>.</p>
<p><span id="more-1208"></span></p>
<p>DOWNLOAD ALL 3 TUTORIALS IN <a href="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/tutorial_PDF.zip">PDF format</a> HERE.</p>
<p>Before we start converting our theme over to wordpress you might want to download and install &#8220;xamp&#8221; this will allow you to run wordpress on your local hard drive saving on bandwidth and internet load times. Your also going to need a theme by &#8220;elliot jay stocks&#8221; called &#8220;starkers&#8221;. The theme is a completely naked theme, its been stripped of all its CSS and HTML, basically giving you a blank wordpress canvas to work on, its ideal for wordpress developers to start from. The theme uses files from wordpress 2.6.2. But this doesnt mean its not going to work with the latest wordpress software, i started with the exact same theme to build my hv-designs website and thats running in wordpress 2.7. If your thinking &#8220;bummer i wanted threaded comments&#8221; well you can easily grab a 2.7 comments file and replace it. Hopefully &#8220;elliot jay stocks&#8221; will release a naked 2.7 theme soon. Any way lets press on once you&#8217;ve downloaded the &#8220;stalkers theme&#8221; extract it to your desktop, rename the stalkers theme folder to &#8220;mywordpress&#8221;, you can also change the screenshot if you wish.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step1.gif" alt="Step1" width="578" height="376" /></p>
<p>In your stalkers theme there is a folder called &#8220;style&#8221; inside this folder are some additional CSS files for IE hacks, typography and reset files. You dont really need this folder so if you want to you can delete it, but keep it by all means if you wish to keep it. Open up the &#8220;style.css&#8221; file in the main &#8220;mywordpress&#8221; theme directory. Once its open you&#8217;ll be greeted with this.</p>
<pre class="brush: css; title: ; notranslate">
/*
Theme Name: Starkers
Theme URI: http://elliotjaystocks.com
Description: The totally nude WordPress theme. Phwoar! (Based on the famous &lt;a href=&quot;http://binarybonsai.com/kubrick/&quot;&gt;Kubrick&lt;/a&gt; by &lt;a href=&quot;http://binarybonsai.com/&quot;&gt;Michael Heilemann&lt;/a&gt;)
Version: 2 (WP2.6.2)
Author: Elliot Jay Stocks
Author URI: http://elliotjaystocks.com
Tags: starkers, naked, clean, basic
*/

@import &quot;style/css/reset.css&quot;;
@import &quot;style/css/typography.css&quot;;
@import &quot;style/css/layout.css&quot;;
</pre>
<p>Delete the 3 imported .CSS files at the bottom of the page, then edit the theme name, description etc&#8230; Mine looks like this.</p>
<pre class="brush: css; title: ; notranslate">
/*
Theme Name: MyWordpress
Theme URI: http://www.hv-designs.co.uk
Description: A wordpress theme
Version: 1
Author: Richard Carpenter
*/
</pre>
<p>Save your .CSS file when you load up the theme in wordpress under the appreance tab you&#8217;l now see this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step2.gif" alt="Step2" width="600" height="313" /></p>
<p>If you havent changed your image you should see a wooden naked body. Which was the orginal starkers theme screenshot. Back to your .CSS file underneath the information we just edited, copy and paste the whole of your CSS templates CSS file into it save and exit. Now open up the &#8220;header.php&#8221; file, you&#8217;ll now be greeted will loads of PHP mixed in with some HTML, the first thing we can do is remove all the code from the TITLE tag at the top of document.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php language_attributes(); ?&gt;&gt;

&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

&lt;title&gt;
&lt;?php if (is_home()) { echo bloginfo('name');
} elseif (is_404()) {
echo '404 Not Found';
} elseif (is_category()) {
echo 'Category:'; wp_title('');
} elseif (is_search()) {
echo 'Search Results';
} elseif ( is_day() || is_month() || is_year() ) {
echo 'Archives:'; wp_title('');
} else {
echo wp_title('');
}
?&gt;
&lt;/title&gt;
</pre>
<p>Once you&#8217;ve deleted the php from the title tag, just replace it with what ever you want to display at the top of the browser.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php language_attributes(); ?&gt;&gt;

&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

&lt;title&gt;MYWORDPRESS &quot;your wordpress slogan can go here&quot;&lt;/title&gt;
</pre>
<p>If you didnt want to manually add your wordpress title instead you can use your blogname, when you installed wordpress it asked for the name of your blog, it is also displayed in your wordpress admin panel at the top. If you wanted to dynamically display that instead of the manual title you can use this bit of code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php language_attributes(); ?&gt;&gt;

&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

&lt;title&gt; &lt;?php bloginfo('name'); ?&gt; &lt;/title&gt;
</pre>
<p>Next still inside the header.php file at the very bottom delete everything underneath the body tag your header.php document should look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &lt;?php language_attributes(); ?&gt;&gt;

&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

&lt;title&gt;MYWORDPRESS &quot;your slogan can go here&quot;&lt;/title&gt;

&lt;meta http-equiv=&quot;content-type&quot; content=&quot;&lt;?php bloginfo('html_type') ?&gt;; charset=&lt;?php bloginfo('charset') ?&gt;&quot; /&gt;
&lt;meta name=&quot;description&quot; content=&quot;&lt;?php bloginfo('description') ?&gt;&quot; /&gt;
&lt;?php if(is_search()) { ?&gt;
&lt;meta name=&quot;robots&quot; content=&quot;noindex, nofollow&quot; /&gt;
&lt;?php }?&gt;

&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&lt;?php bloginfo('stylesheet_url'); ?&gt;&quot; media=&quot;screen&quot; /&gt;
&lt;link rel=&quot;alternate&quot; type=&quot;application/rss+xml&quot; title=&quot;&lt;?php bloginfo('name'); ?&gt; RSS Feed&quot; href=&quot;&lt;?php bloginfo('rss2_url'); ?&gt;&quot; /&gt;
&lt;link rel=&quot;pingback&quot; href=&quot;&lt;?php bloginfo('pingback_url'); ?&gt;&quot; /&gt;

&lt;?php wp_head(); ?&gt;

&lt;/head&gt;

&lt;body&gt;
</pre>
<p>All the content we add now will be pasted in underneath the body tag. Copy your images folder from your CSS templates directory and paste it into the themes directory. Open up your index.html file from your CSS template. Copy everything from the opening &#8220;container DIV&#8221; to the ending &#8220;navigation DIV&#8221;. Paste it underneath the body tag. Save your header.php file, if you check the theme in your browser it should look like this.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step3.gif" alt="Step3" width="600" height="421" /></p>
<p>Pretty quick eh??, we just need to make a few tweaks and the header file should be complete. On our navigation we have a list that we created page #1, page #2, page #3 etc&#8230; well we want wordpress to add our pages dynamically when we goto add page in our admin panel. To do this we change our navigation to look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;navigation&quot;&gt;&lt;!--navigation starts--&gt;

&lt;ul class=&quot;nav_links&quot;&gt;
&lt;li&gt; &lt;a href=&quot;http://www.your_page_here.com&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;withdiv&quot;&gt;&lt;?php wp_list_pages('sort_column=menu_order&amp;amp;amp;amp;title_li='); ?&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;&lt;!--navigation ends--&gt;
</pre>
<p>We can keep the 1st button &#8220;home&#8221; just link it to your main domain name &#8220;http://www.what_ever.com. But underneath we can delete page #1 &#8211; page #9 and just add the one line off php wrapped in out LI tag. The php basically gets your wordpress pages from the database and displays them in page order. If you only had say one wordpress page and loads of external pages you wanted to use then just add another page underneath like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;navigation&quot;&gt;&lt;!--navigation starts--&gt;

&lt;ul class=&quot;nav_links&quot;&gt;
&lt;li&gt;&lt;a href=&quot;http://www.your_page_here.com&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li class=&quot;withdiv&quot;&gt;&lt;?php wp_list_pages('sort_column=menu_order&amp;amp;amp;amp;title_li='); ?&gt;&lt;/li&gt;
&lt;li class=&quot;withdiv&quot;&gt;&lt;a href=&quot;http://www.your_external_page.com&quot;&gt;External Page&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;&lt;!--navigation ends--&gt;
</pre>
<p>You can have as many as you like within reason, anything that overflows the 900px navigation will just mess the layout up so be carefull. Another item we need to tweak is our search field, delete the form structure from your search DIV and add the following peice of PHP.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;search&quot;&gt;&lt;!--search starts--&gt;
&lt;?php include (TEMPLATEPATH . &quot;/searchform.php&quot;); ?&gt;
&lt;/div&gt;&lt;!--search ends--&gt;
</pre>
<p>If you check your theme in your browser now, you&#8217;l notice the search form has lost all its styling. Open up &#8220;searchform.php&#8221; from your &#8220;mywordpress theme folder&#8221;. This file contains our search form and looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;
&lt;label class=&quot;hidden&quot; for=&quot;s&quot;&gt;&lt;?php _e('Search for:'); ?&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; value=&quot;&lt;?php the_search_query(); ?&gt;&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;
</pre>
<p>All&#8217;s we need to do is add our class of &#8220;search-field&#8221; and &#8220;search-button&#8221; which we created when we created our CSS template. The form now looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form method=&quot;get&quot; id=&quot;searchform&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;/&quot;&gt;
&lt;label class=&quot;hidden&quot; for=&quot;s&quot;&gt;&lt;/label&gt;
&lt;input type=&quot;text&quot; class=&quot;search-field&quot; value=&quot;Search...&quot; name=&quot;s&quot; id=&quot;s&quot; /&gt;
&lt;input type=&quot;submit&quot; id=&quot;searchsubmit&quot; class=&quot;search-button&quot; value=&quot;Go!&quot; /&gt;
&lt;/form&gt;
</pre>
<p>We&#8217;ve applyed our search form classes, deleted the the &#8220;search for&#8221; text before the search field and changed the word on the submit button from &#8220;search&#8221; to &#8220;go!&#8221;. Close the searchform.php file and check your theme in your browser to see the changes you can also test out your search form it should now work, you wont see anything exciting as we need to style our search results page. Thats it for the header.php file you can now close it. Now open up your &#8220;index.php&#8221; file in from your themes directory. The index.php file is the main page of our website, this is the 1st page people will see when logging onto your website. We have quite abit of work to do, to get it working. All the PHP code wrapped inside the H2 tag is the title of the post.</p>
<p align="center"><!--adsense#hv_banner--></p>
<pre class="brush: php; title: ; notranslate">
&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
</pre>
<p>The PHP code wrapped in the P tag underneath is the date.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/p&gt;
</pre>
<p>Then there a line of PHP code underneath the P tag which says.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php the_content('Read the rest of this entry &amp;amp;amp;amp;raquo;'); ?&gt;
</pre>
<p>This displays the content of the post, and when you use the wordpress more tag to cut off your posts the text &#8220;read the rest of this entry&#8221; is displayed. Then finally we have another P tag.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt; &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
</pre>
<p>This PHP displays the tags if there any for the post, it displays what catergorie the post was posted in and shows how many comments were made on the posts. Now we need to jumble all this PHP around so it displays the way we want, like our CSS template. Firstly we need to copy and paste a couple of DIV tags in there from our CSS template. The 1st two DIV tags we need to add are DIV ID content and DIV ID content-left. We add these two DIV&#8217;s at the very top underneath GET HEADER.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;

&lt;?php if (have_posts()) : ?&gt;
</pre>
<p>Then at the very bottom of our page above GET SIDEBAR we need to end our content left DIV.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php endif; ?&gt;

&lt;/div&gt;&lt;!--content left ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>Now we need to add our &#8220;a-post&#8221; class to the document we add this just above div class post and end it underneath the PHP code containing the tags and number of comments etc&#8230;</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--p while (have_posts()) : the_post();--&gt;
&lt;div class=&quot;a-post&quot;&gt;&lt;!--wordpress post starts--&gt;&lt;/div&gt;
&lt;div id=&quot;post-&lt;?php the_ID(); ?&gt;&quot; class=&quot;post&quot;&gt;
&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/p&gt;&lt;/div&gt;
&lt;?php the_content('Read the rest of this entry &amp;amp;amp;amp;raquo;'); ?&gt;

&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt; &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;

&lt;!--wordpress post ends--&gt;

&lt;!--p endwhile;--&gt;
</pre>
<p>We now need to start sorting through the PHP code and get rid of what we dont want to be displayed. At the very bottom around line 34 you should see.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php include (TEMPLATEPATH . &quot;/searchform.php&quot;); ?&gt;
</pre>
<p>This line will display a search field when a post cant be found, we have a search field in our header already so we dont really need a 2nd one. Delete the one line of code. Scroll up to the PHP code which contains the post tags and amount of comments.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt; Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php edit_post_link('Edit', '', ' | '); ?&gt; &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
</pre>
<p>On our main page we dont really need the tags, or the edit post link, so the delete these two lines.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php the_tags('Tags: ', ', ', '&lt;br /&gt;'); ?&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
&lt;?php edit_post_link('Edit', '', ' | '); ?&gt;
</pre>
<p>Your code should now look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
</pre>
<p>We now need to start copying and pasting our post classes over to our theme. The first one we need to copy over will be for our thumbnail code. Copy the class &#8220;post-img&#8221; from our CSS template, paste it underneath the &#8220;div class post&#8221;. The code looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;a-post&quot;&gt;&lt;!--wordpress post starts--&gt;

&lt;div class=&quot;post&quot; id=&quot;post-&lt;?php the_ID(); ?&gt;&quot;&gt;

&lt;div class=&quot;post-img&quot;&gt;
&lt;img src=&quot;images/post_thumbnail.png&quot; alt=&quot;Test Image&quot; /&gt;
&lt;/div&gt;
</pre>
<p>We then had some PHP wrapped in a H2 tag, change the H2 tag to a H1 tag then wrap the whole thing in our &#8220;post-title class&#8221; from our CSS template.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-title&quot;&gt;
&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>We then need to move over our &#8220;post-desc class&#8221; from our CSS template, we wrap this class around the post content PHP.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-desc&quot;&gt;&lt;?php the_content('Read the rest of this entry &amp;amp;amp;amp;raquo;'); ?&gt;&lt;/div&gt;
</pre>
<p>Our index.php all in all should now look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;

&lt;?php if (have_posts()) : ?&gt;

&lt;!--p while (have_posts()) : the_post();--&gt;
&lt;div class=&quot;a-post&quot;&gt;&lt;!--wordpress post starts--&gt;&lt;/div&gt;
&lt;div class=&quot;post-img&quot;&gt;
&lt;img src=&quot;images/post_thumbnail.png&quot; alt=&quot;Test Image&quot; /&gt;
&lt;/div&gt;

&lt;div class=&quot;post-title&quot;&gt;
&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;post-desc&quot;&gt;&lt;?php the_content('Read the rest of this entry &amp;amp;amp;amp;raquo;'); ?&gt;&lt;/div&gt;
&lt;p&gt;Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;

&lt;!--wordpress post ends--&gt;

&lt;!--p endwhile;--&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;!--p next_posts_link('&amp;laquo; Older Entries')--&gt;&lt;/li&gt;
	&lt;li&gt;&lt;!--p previous_posts_link('Newer Entries &amp;raquo;')--&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;!--p else :--&gt;
&lt;h2&gt;Not Found&lt;/h2&gt;
Sorry, but you are looking for something that isn't here.

&lt;?php endif; ?&gt;

&lt;/div&gt;&lt;!--content left ends--&gt;

&lt;?php get_sidebar(); ?&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>Underneath our &#8220;post-desc&#8221; class we have this code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;Posted in &lt;?php the_category(', ') ?&gt; | &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
</pre>
<p>We want to delete the first chunk which basically says &#8220;posted in and then some php code&#8221;. We dont really need this bit. So the code would look like this after its been deleted.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
</pre>
<p>We then need to delete the starting P tag and ending P tag from the code above, then cut the PHP code and paste it into the post title class next to the PHP code for the time and date.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;post-title&quot;&gt;
&lt;h1&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;?php the_time('F jS, Y') ?&gt; &lt;!-- by &lt;?php the_author() ?&gt; --&gt; | &lt;?php comments_popup_link('No Comments &amp;amp;amp;amp;#187;', '1 Comment &amp;amp;amp;amp;#187;', '% Comments &amp;amp;amp;amp;#187;'); ?&gt;&lt;/p&gt;
&lt;/div&gt;
</pre>
<p>Thats it for the index.php file for now. Now lets get the sidebar sorted, open up your sidebar.php, most of the code at the top can go. Delete from.</p>
<pre class="brush: php; title: ; notranslate">
&lt;ul&gt;
&lt;?php /* Widgetized sidebar, if you have the plugin installed. */
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?&gt;
</pre>
<p>All the way down to.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php wp_list_pages('title_li=&lt;h2&gt;Pages&lt;/h2&gt;' ); ?&gt;
</pre>
<p>Now above the code above add</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;side-bar&quot;&gt;&lt;!--sidebar starts--&gt;
</pre>
<p>At the very bottom of the page add your sidebar ending and content ending DIV&#8217;s.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;/div&gt;&lt;!--sidebar ends--&gt;
&lt;/div&gt;&lt;!--content ends--&gt;
</pre>
<p>Now change ALL H2 tags to H1 tags. Your search bar is complete, if you test your theme in the browser you will see the sidebar is not the same as our CSS template. If your not really that bothered about having all the catergores, archives etc.. in the sidebar and want to create something on your own, then just remove all the code from inbetween the sidebar opening and ending tags. Then just create your own sidebar as we did in our CSS template. Id highly recommend wrapping your &#8220;custom&#8221; sidebar content in the sidebar-content class.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;side-bar-content&quot;&gt;
</pre>
<p>Which we used in our CSS template. I always find it best to create your own sidebar from scratch. Now lets sort out our footer, open your footer.php file, there shouldn&#8217;t be alot of content in there just highlight it all and hit the delete key. In your index.HTML file from the CSS template copy this chunk of code.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;/div&gt;&lt;!--container ends--&gt;

&lt;div id=&quot;footer&quot;&gt;&lt;!--footer starts--&gt;

&lt;div id=&quot;footer-topbar&quot;&gt;
&lt;h1&gt;mywordpress&lt;span&gt; &quot;Your fancy wordpress slogan here&quot;&lt;/span&gt;&lt;/h1&gt;
&lt;/div&gt;

&lt;div id=&quot;footer-content&quot;&gt;
&lt;p&gt;Copyright &amp;amp;amp;amp;copy; mywordpress.co.uk | All Rights Reserved&lt;br /&gt;
Design By &lt;a href=&quot;http://www.hv-designs.co.uk&quot;&gt;HV-Designs.co.uk&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;/div&gt;&lt;!--footer ends--&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Paste it into your footer.php file, save and exit. Refresh your theme in your browser to see the changes. The footer is as easy as that. The theme is nearly complete we just need to tweak a few more pages. Open up &#8220;page.php&#8221; this file relates to single pages which we add through the wordpress admin panel. The tags we added to our index.php file can also be used in this file. Underneath the &#8220;get header php code&#8221; add this code.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;
&lt;div class=&quot;a-post&quot;&gt;
</pre>
<p>At the very bottom above the &#8220;get sidebar php&#8221; code add.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Your &#8220;page.php&#8221; code should now look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--p get_header();--&gt;

&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;
&lt;div class=&quot;a-post&quot;&gt;

&lt;!--p if (have_posts()) : while (have_posts()) : the_post();--&gt;
&lt;h2&gt;&lt;!--p the_title();--&gt;&lt;/h2&gt;
&lt;!--p the_content('&lt;br--&gt;
&lt;p class=&quot;serif&quot;&gt;Read the rest of this page »&lt;/p&gt;

'); ?&gt;
&lt;!--p wp_link_pages(array('before'--&gt;'&lt;strong&gt;Pages:&lt;/strong&gt; ', 'after' =&gt; '

', 'next_or_number' =&gt; 'number')); ?&gt;

&lt;!--p endwhile; endif;--&gt;
&lt;!--p edit_post_link('Edit this entry.', '
&lt;div  mce_tmp=&quot;1&quot;&gt;', '&lt;/div&gt;
&lt;div  mce_tmp=&quot;1&quot;&gt;');--&gt;

&lt;/div&gt;
&lt;/div&gt;

&lt;!--p get_sidebar();--&gt;

&lt;!--p get_footer();--&gt;
</pre>
<p>If you check a page on your theme it should now be wrapped in a box like we used for our main posts in the index.php file. This wont be the first time you&#8217;ll reuse the code, we can use the same code in our search.php file which displays our search results within our wordpress theme, which brings me to our next file. Open up your index.php file and goto &#8220;file &gt; save as&#8221; save the index.php as &#8220;search.php&#8221; overwrite the existing file. All done, when you search using the search field in the header, the search results will be displayed the same as our posts. Obvisouly you can make your search results look how they want by applying different styles and DIV&#8217;s to the file. Now open up &#8220;archive.php&#8221; underneath the &#8220;get header php code&#8221; add the following.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;
&lt;div class=&quot;a-post&quot;&gt;
</pre>
<p>At the very bottom of above the &#8220;get sidebar php&#8221; code add two ending DIV&#8217;s.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Everything thats in your wordpress archive like posts by categorie, posts with the same tags, posts posted on the same day etc&#8230; all this information will be displayed like our single pages are. If you make a post with a couple of tags or click a month under the &#8220;archives&#8221; section in the sidebar you&#8217;ll see how its displayed. Again you can make it display what you want how you want. Have you noticed a pattern emerging????? most of the files use the same PHP tags but its just displayed in a different way. You can make your archives page look the same as your search page and index.php page, you just need to add the relative &#8220;classes / DIV&#8217;s&#8221; to the &#8220;post loop&#8221;. Right now time for our 404 page. Open up the 404.php file. again add the post code from our CSS template.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;

&lt;div class=&quot;a-post&quot;&gt;&lt;!--wordpress post starts--&gt;

&lt;h2&gt;Error 404 - Not Found&lt;/h2&gt;

&lt;/div&gt;
&lt;/div&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<p>Theres only two more files left to edit then your theme is complete. Ive left these two files till last because they are sometime abit fiddley. Open up your &#8220;single.php&#8221; file underneath the &#8220;get header php code&#8221; add the post classes.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot;&gt;&lt;!--content starts--&gt;
&lt;div id=&quot;content-left&quot;&gt;&lt;!--content left starts--&gt;

&lt;div class=&quot;a-post&quot;&gt;&lt;!--wordpress post starts--&gt;
</pre>
<p>Scroll down to the very bottom above the &#8220;get footer code&#8221; add the two ending DIV&#8217;s. The sidebar is not included in the single.php file so we need to add it manually. Underneath the two ending DIV&#8217;s add the get sidebar php code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;!--p endif;--&gt;

&lt;/div&gt;
&lt;/div&gt;

&lt;!--p get_sidebar();--&gt;

&lt;!--p get_footer();--&gt;
</pre>
<p>Load up your theme in the browser and check what your post pages look like. Look ok, the comments field looks abit big for our theme, so our next job is to shorten it. Open up your &#8220;comments.php&#8221; file. Near the bottom locate the form. Which looks like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;form action=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;

&lt;?php if ( $user_ID ) : ?&gt;

&lt;p&gt;Logged in as &lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-admin/profile.php&quot;&gt;&lt;?php echo $user_identity; ?&gt;&lt;/a&gt;. &lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?action=logout&quot; title=&quot;Log out of this account&quot;&gt;Log out &amp;amp;amp;amp;raquo;&lt;/a&gt;&lt;/p&gt;

&lt;?php else : ?&gt;

&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;author&quot;&gt;Name &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;

&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo $comment_author_email; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;2&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;email&quot;&gt;Mail (will not be published) &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;

&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
&lt;label for=&quot;url&quot;&gt;Website&lt;/label&gt;

&lt;?php endif; ?&gt;

&lt;p&gt;&lt;strong&gt;XHTML:&lt;/strong&gt; You can use these tags: &lt;code&gt;&lt;?php echo allowed_tags(); ?&gt;&lt;/code&gt;&lt;/p&gt;

&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;

&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Submit Comment&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;comment_post_ID&quot; value=&quot;&lt;?php echo $id; ?&gt;&quot; /&gt;
&lt;?php do_action('comment_form', $post-&gt;ID); ?&gt;

&lt;/form&gt;
</pre>
<p>At the bottom of this code you should see the text area.</p>
<pre class="brush: php; title: ; notranslate">
&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;
</pre>
<p>Notice the &#8220;columns&#8221; are set to 100%, thats where our problem lies. Remove the &#8220;%&#8221; and change to 70. It should now look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;70&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;
</pre>
<p>Test the changes in your browser, the text area is now a snug fit my end. Our next problems lie&#8217;s with our text input fields, there is a quick fix for these. At the begining of each form field add the P tag then at the end add the ending P tag.</p>
<pre class="brush: php; title: ; notranslate">
&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;author&quot;&gt;Name &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo $comment_author_email; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;2&quot; &lt;?php if ($req) echo &quot;aria-required='true'&quot;; ?&gt; /&gt;
&lt;label for=&quot;email&quot;&gt;Mail (will not be published) &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/label&gt;&lt;/p&gt;

&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
&lt;label for=&quot;url&quot;&gt;Website&lt;/label&gt;&lt;/p&gt;
</pre>
<p>You can add your own styles to the form boxes, just make a class with some styless in your CSS file, then apply the class to the input form boxes. Another problem with have is our text boxes sit right on top of our XHTML text. To sort this add a BR tag after the last form box.</p>
<pre class="brush: php; title: ; notranslate">

&lt;input id=&quot;url&quot; name=&quot;url&quot; size=&quot;22&quot; type=&quot;text&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; tabindex=&quot;3&quot; /&gt;
&lt;label for=&quot;url&quot;&gt;Website&lt;/label&gt;

&lt;!--p endif;--&gt;

&lt;!--BR TAG GOES HERE--&gt;

&lt;strong&gt;XHTML:&lt;/strong&gt; You can use these tags: &lt;code&gt;&lt;!--p echo allowed_tags();--&gt;&lt;/code&gt;

&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;70&quot; rows=&quot;10&quot; tabindex=&quot;4&quot;&gt;&lt;/textarea&gt;

&lt;input id=&quot;submit&quot; name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Submit Comment&quot; tabindex=&quot;5&quot; /&gt;
&lt;input name=&quot;comment_post_ID&quot; type=&quot;hidden&quot; value=&quot;&lt;?php echo $id; ?&gt;&quot; /&gt;
&lt;!--p do_action('comment_form', $pos--&gt;ID); ?&gt;
</pre>
<p>Now make some example comments on your theme, you&#8217;ll notice they aint very nice too look at, everything is close together, theres basically no styling or nothing. This is where we need to start adding some basic styling of our own. In our comments.php file scroll towards the top to locate the comments loop. We need to add two new classes the first class is a class of &#8220;comment-box&#8221; this wraps the whole comments loop, dont forget to end the class at the bottom. The second class is a class for our gravatar, you can see where the gravatar is called in php by looking at the code below.</p>
<p align="center"><!--adsense#hv_banner--></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php foreach ($comments as $comment) : ?&gt;

&lt;div class=&quot;comment-box&quot;&gt;&lt;!--NEW CLASS--&gt;

&lt;li &lt;?php echo $oddcomment; ?&gt;id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;

&lt;div class=&quot;gravatar&quot;&gt;&lt;!--NEW CLASS--&gt;
&lt;?php echo get_avatar( $comment, 32 ); ?&gt;&lt;!--GRAVATAR IS CALLED--&gt;
&lt;/div&gt;

&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
&lt;p&gt;Your comment is awaiting moderation.&lt;/p&gt;
&lt;?php endif; ?&gt;
&lt;p&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('edit','&amp;amp;amp;amp;nbsp;&amp;amp;amp;amp;nbsp;',''); ?&gt;&lt;/p&gt;
&lt;?php comment_text() ?&gt;
&lt;/li&gt;
&lt;/div&gt;
</pre>
<p>Open up your CSS file for the theme and add your classes.</p>
<pre class="brush: css; title: ; notranslate">
.comment-box {
border: 1px dashed #666666;
margin-bottom: 10px;
padding: 5px;
float: left;
text-align: justify;
width: 565px;
}

.gravatar {
float: right;
margin: 5px;
}
</pre>
<p>To the whole comment loop were going to add a 1 pixel dashed border, a bottom margin to seperate each comment, then add 5 px padding so the content inside the comments box arn&#8217;t right against the dashed lines, we then float out box left, justify our text and set a width of 565px. We then add our styling for our gravatar image, We just want to float the gravatar image to the right and add a 5px margin all the way around the image. The comment text should flow around our gravatar image. You can also change the size of your gravatar image by altering the number in the code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div class=&quot;gravatar&quot;&gt;
&lt;?php echo get_avatar( $comment, 32 ); ?&gt;
&lt;/div&gt;
</pre>
<p>The number 32 in the code means the image will be 32px by 32 px. Try changing to something eles, i find 72 is a nice size. Save and test what your comments look like in your browser. They dont look too bad. Still think it needs some work. Lets insert a line break inbetween the date and time, locate the time and date in the loop.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php foreach ($comments as $comment) : ?&gt;
&lt;div class=&quot;comment-box&quot;&gt;
&lt;li &lt;?php echo $oddcomment; ?&gt;id=&quot;comment-&lt;?php comment_ID() ?&gt;&quot;&gt;

&lt;div class=&quot;gravatar&quot;&gt;
&lt;?php echo get_avatar( $comment, 72 ); ?&gt;
&lt;/div&gt;

&lt;cite&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt; Says:
&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
&lt;p&gt;Your comment is awaiting moderation.&lt;/p&gt;
&lt;?php endif; ?&gt;
&lt;p&gt;&lt;a href=&quot;#comment-&lt;?php comment_ID() ?&gt;&quot; title=&quot;&quot;&gt;&lt;?php comment_date('F jS, Y') ?&gt; at &lt;?php comment_time() ?&gt;&lt;/a&gt; &lt;?php edit_comment_link('edit','&amp;amp;amp;amp;nbsp;&amp;amp;amp;amp;nbsp;',''); ?&gt;&lt;/p&gt;

&lt;br /&gt;&lt;!--ADD THE BR TAG HERE--&gt;

&lt;?php comment_text() ?&gt;
&lt;/li&gt;
&lt;/div&gt;
</pre>
<p>Thats pretty much it for the comments, obviously you can take more time to per-fect the look of your theme. Test your theme in the browser, ive tested mine in firefox and internet explorer and it works fine, there are a few minor bugs which we&#8217;ll sort now. If you notice in firefox there are numbers next to the comments and bullet points here and there. Open up the CSS file and paste in the following rule.</p>
<pre class="brush: css; title: ; notranslate">
ul, ol {
list-style:none;
}
</pre>
<p>Another bug you&#8217;ll notice is that wordpress doesnt include the line breaks inbetween text on pages (NOT POSTS) and comments. To sort this we just need to add.</p>
<pre class="brush: css; title: ; notranslate">
#content p {
margin: 5px 0 10px;
padding: 0;
}

.comment-box p {
margin: 5px 0 10px;
padding: 0;
}
</pre>
<p>I am sorry if ive missed any bugs. The theme is complete the only snippet of code id add now is so we can use custom fields for our post images. Open up your index.php file and locate the class &#8220;post-img&#8221; within the post loop.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;post-img&quot;&gt;
&lt;img src=&quot;images/post_thumbnail.png&quot; alt=&quot;Test Image&quot; /&gt;
&lt;/div&gt;
</pre>
<p>Delete the code containing the image and replace with the code below. The code below basically means if a post used a custom field of image display the thumbnail, if the post uses an image apply the url.</p>
<pre class="brush: php; title: ; notranslate">
&lt;a href=&quot;&lt;?php $values = get_post_custom_values(&quot;url&quot;); echo $values[0]; ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
&lt;img src=&quot; &lt;?php $values = get_post_custom_values(&quot;image&quot;); echo $values[0]; ?&gt;&quot; alt=&quot;&lt;?php the_title(); ?&gt;&quot; /&gt;&lt;/a&gt;
</pre>
<p>So when were in wordpress and we make a post instead of inserting it into the actual post we goto our custom fields section at the bottom.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step4.gif" alt="Step4" width="600" height="197" /></p>
<p>Enter our first custom field of &#8220;image&#8221;.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step5.gif" alt="Step5" width="600" height="152" /></p>
<p>Click add custom field, do the same for the next field, enter &#8220;url&#8221; then enter the url of the post.</p>
<p><img src="http://www.hv-designs.co.uk/tutorials/mywordpress_pt3/step6.gif" alt="Step6" width="600" height="281" /></p>
<p>Once you have entered the custom fields once, when you add more posts the custom fields will be available within a drop down box.</p>
<h2>Finally The End</h2>
<p>The end, you should now have a working wordpress theme from a PSD file we created a couple of days ago, although this tutorial wont make you a wordpress developer over night&#8230;. its a start. The PHP part of a wordpress theme is pretty simple and isnt hard to work out whats what. There is loads of documentation over at wordpress.org to help you with certain things if you ever get stuck. Id also suggest downloading a wordpress cheat sheet, someone made one a while back but i dont have the link. Also diving into wordpress can be a right pain and i can safely say it will piss you off big time. You&#8217;ve just got to work at it and work at it, another thing id suggest is to make and code each file before you start the wordpress side of coding, that way most of the hard work would of been done, it will just be a case of sifting through the loops. Il try to make a couple more wordpress tutorials in the near future. Any questions just ask. See you next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2009/03/31/psd-to-css-to-wordpress-pt3/feed/</wfw:commentRss>
		<slash:comments>84</slash:comments>
		</item>
		<item>
		<title>Site To WordPress Tutorial</title>
		<link>http://www.hv-designs.co.uk/2007/10/10/site-to-wordpress-tutorial/</link>
		<comments>http://www.hv-designs.co.uk/2007/10/10/site-to-wordpress-tutorial/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 18:40:37 +0000</pubDate>
		<dc:creator>Richard Carpenter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://hv-designs.co.uk/wordpress/?p=167</guid>
		<description><![CDATA[Okay so you have your website built and coded into css/xhtml and you want to convert it over to a wordpress theme. Firstly let me explain a few things. WordPress works in a rather straightforward manner but it may seem confusing if you are completely new to the concept. WordPress relies on PHP to call [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-167"></span><br />
Okay so you have your website built and coded into css/xhtml and you want to convert it over to a wordpress theme. Firstly let me explain a few things.</p>
<p>WordPress works in a rather straightforward manner but it may seem confusing if you are completely new to the concept. WordPress relies on PHP to call on different parts of your content from the database management system it stands on. If you view my code to my site you will notice i use php to call some aspects of my page. Once you get started its pretty easy althou understanding of css/php/xhtml is essential and will guide you throu the setup of a full working wordpress theme.</p>
<p align="center"><!--adsense#hv_banner--></p>
<p>Now you should already have your site designed and coded into css/xhtml before attempting this tutorial, firstly create a new folder on your desktop, name this folder what ever you want (e.g my theme). Now open up notepad dont type anything just goto &#8220;file &gt; save as&#8221; and save it has style.css then goto &#8220;file &gt; save as&#8221; again and save it as index.php. Now believe it or not but these are the only 2 files you actually need for a wordpress theme.</p>
<p>Open up your style sheet to your website, highlight it all then copy/paste into the blank &#8220;style.css&#8221; file you just created.</p>
<p>Now copy/paste this bit of code into the top of your style.css file.</p>
<p>/*<br />
Theme Name: <span class="style10">Replace with your Theme&#8217;s name.</span><br />
Theme URI: <span class="style10">Your Theme&#8217;s URI</span><br />
Description: <span class="style10">A brief description.</span><br />
Version: 1.0<br />
Author: <span class="style10">You</span><br />
Author URI: <span class="style10">Your website address.</span><br />
*/</p>
<p>Change the lines of code in red to suit your needs. These few lines of code are what wordpress uses to define it as a wordpress theme/template.</p>
<p>Thats the style sheet sorted. Now we need to chop up our website code. Remember how we talked about WordPress using PHP to call data from your database? Well WordPress can also use PHP to call different files from within your template folder. Imagine your current XHTML code chopped up into 4 (or more) different sections. The header, sidebar, main content and footer. Instead of keeping these 4 parts of the XHTML together in one file, you are going to put each of them in their own separate file. Then call on them one by one using PHP.</p>
<p>Open up notepad and create a further 3 files the same way we did with the style.css and index.php this time use the filenames &#8220;header.php , sidebar.php , footer.php&#8221; (make sure all these files are in the same directory). Load up your ftp program and go into your wordpress folder, save the classic theme folder your computer as we need to use bits of code out of the orginal files.</p>
<p><strong>(/wp-content/themes/classic/)</strong></p>
<p>Locate the classic themes header.php file. Notice all the PHP that is used in between the &lt;head&gt; tags. You will want to keep most of this code, so just copy the whole &lt;head&gt; section into your new header.php file. Now open up your original XHTML/CSS file and copy only the header elements or the code you have used to create the header. Paste into your new header.php file (underneath the &lt;head&gt; section). Save and close.</p>
<p>Now open up the blank index.php you created at the start, open up your website and copy only the main content code (NOT the sidebar or footer). Paste this code into your new index.php file. Save and close.</p>
<p>Open up the blank sidebar.php and footer.php. Copy and paste your sidebar code from your website into the blank sidebar.php file Do the same for the footer.php file.</p>
<p>If your original code contains any images i suggest you copy/paste them into a folder in your theme folder called &#8220;images&#8221; . Now lets put it back together using a few lines of PHP, open up index.php copy/paste these lines of code into the top of the file above everything eles,</p>
<p><span class="style10">&lt;?php get_header(); ?&gt; </span></p>
<p>Now goto the bottom of that file and paste these lines of code below everything eles.</p>
<p><span class="style10">&lt;?php get_sidebar(); ?&gt;<br />
&lt;?php get_footer(); ?&gt; </span></p>
<p>These 3 simple lines of PHP are telling WordPress to fetch and display your header.php, sidebar.php, and footer.php files within your index.php file. Your code is officially put back together. Now if you want to edit your sidebar you can just edit your sidebar.php file, instead of sorting through your index.php to find it. The same goes for your header.php and your footer.php.</p>
<p align="center"><!--adsense#synwave_banner--></p>
<p>Your index.php is nearly complete, the final step is to insert the actual content into the code. Luckily, WordPress uses PHP for this as well. <a href="http://codex.wordpress.org/The_Loop">The Loop</a> is the PHP function WordPress uses to call and display your posts from the database they are saved in. Look in your <strong>/wp-content/themes/classic/</strong> directory and open the file index.php file. Copy everything in between <span class="style10">&lt;?php get_header(); ?&gt; and <span class="style10">&lt;?php get_footer(); ?&gt;</span></span><span class="style10">to your clipboard. Now paste it into your new theme’s index.php file inside of whichever <strong>div</strong> you are using to hold your content. You just inserted a basic version of the loop into your code. WordPress will use the loop to display your posts and comments on your website.</span>Now upload your theme folder to <strong>/wp-content/themes/.</strong> Then log into WordPress and activate your theme.</p>
<p> </p>
<p>This tutorial covered the basics for converting your theme to WordPress. To further customize and enhance your theme start looking at the <a href="http://codex.wordpress.org/Main_Page">WordPress Codex</a>, specifically <a href="http://codex.wordpress.org/Template_Tags">Template Tags</a> and <a href="http://codex.wordpress.org/Templates">Template Files</a>. You can use template tags in your sidebar, in your header, or your footer to call menus, categories, posts, etc. As you learn more about template tags and template files you will discover the endless possiblities for customizing your new WordPress blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hv-designs.co.uk/2007/10/10/site-to-wordpress-tutorial/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.hv-designs.co.uk @ 2012-02-11 18:59:27 -->
