Subscribe Via RSS

3588 Subscribers

Subscribe Via RSS
Subscribe Via Twitter

Followers

Subscribe Via Twitter
BLOOpress WordPress Theme

April 24th, 2009 in Wordpress Tutorials by Richard Carpenter

BLOOpress WordPress Theme

1 Star2 Stars3 Stars4 Stars5 Stars11 Votes, Rating: 4.82
Loading ... Loading ...
About The Author

About The Author: Richard Carpenter

Hi im Richard Carpenter im a freelance web and graphics designer from England. I am also a regular Blogger, Tutorial Writer, and Contributor for HV-Designs. You can follow me on twitter HERE. You may also view my portfolio HERE.

 

Richard Carpenter has written 364 posts.

Hello welcome to part 3 of the BLOOpress wordpress theme. Today we’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 “XAMPP”, 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 “starkers theme” by elliot jay stocks. Place your starkers theme inside your wordpress theme’s directory, then rename it too “BLOOpress Theme”. Delete the folder “style” and its contents as they arn’t needed. Create a new folder called “images” 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.

Step1

Open up the “style.CSS” file from within the theme directory, you should be presented with some code which looks like this.

[sourcecode language='css']
/*
Theme Name: Starkers
Theme URI: http://elliotjaystocks.com
Description: The totally nude WordPress theme. Phwoar! (Based on the famous Kubrick by Michael Heilemann)
Version: 2 (WP2.6.2)
Author: Elliot Jay Stocks
Author URI: http://elliotjaystocks.com
Tags: starkers, naked, clean, basic
*/

@import “style/css/reset.css”;
@import “style/css/typography.css”;
@import “style/css/layout.css”;
[/sourcecode]

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’ve already deleted them. My code now looks like this.

[sourcecode language='css']
/*
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
*/
[/sourcecode]

After you’ve edited the code we need to copy all our CSS styles from our CSS template’s style sheet and paste them inside the theme’s “style.CSS” file. Save your themes’s style sheet and activate the theme in wordpress, view your theme in your browser, you should be presented with something like this.

Step2

MODIFYING THE HEADER.PHP FILE

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.

[sourcecode language='php']
<br /> <?php if (is_home()) { echo bloginfo('name');<br /> } elseif (is_404()) {<br /> echo '404 Not Found';<br /> } elseif (is_category()) {<br /> echo 'Category:'; wp_title('');<br /> } elseif (is_search()) {<br /> echo 'Search Results';<br /> } elseif ( is_day() || is_month() || is_year() ) {<br /> echo 'Archives:'; wp_title('');<br /> } else {<br /> echo wp_title('');<br /> }<br /> ?><br />
[/sourcecode]

You can remove all the PHP from within the TITLE tag, replace the code with a simple title for your theme.

[sourcecode language='html']

[/sourcecode]

The next thing we need to do is locate this chunk of text right at the bottom of the PHP file.

[sourcecode language='php']

Copy all the hightlighted code and paste into your header.PHP file underneath the body tag. Once you’ve pasted the code save your .PHP file and check the theme in your browser, heres mine.

Step4

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.

[sourcecode language='php']


[/sourcecode]

If you open up the “index.PHP” file and locate the following code.

Step5

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…. hope that makes sense. Copy the code from the index.PHP file and paste it between our “search-form” DIV.

[sourcecode language='php']



[/sourcecode]

Now we need to alter our PHP file “searchform.php”. 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.

[sourcecode language='php']

[/sourcecode]

The first thing we can do is remove line 2, the label class.

[sourcecode language='php']

[/sourcecode]

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 “Search…”. Then on the 2nd input type change the “value” attribute from search to “go!”.

[sourcecode language='php']

[/sourcecode]

Now add your classes, remember in our CSS template we had two styles one for the button and one for the text field.

[sourcecode language='php']

[/sourcecode]

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 “type=image”. Next to the “type=image” attribute we need to add our image SRC.

[sourcecode language='php']


[/sourcecode]

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.

[sourcecode language='html']


[/sourcecode]

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.

[sourcecode language='php']


[/sourcecode]

Step6

Thats it the header.PHP file is complete.

MODIFYING THE INDEX.PHP FILE

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’s upon entering your blog. The bit we’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.

Step7

The code above is the part we’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 “get header”. Our post starts with “post-box” paste our class of post-box underneath the PHP code “have posts”. Add your left-content ending DIV right at the bottom of the file above the “get sidebar” PHP code.

[sourcecode language='php']


[/sourcecode]

Underneath our post loop add the ending DIV for left-content.

[sourcecode language='php']

” rel=”bookmark” title=”Permanent Link to “>


EXAMPLE THUMBNAIL



[/sourcecode]

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 & date and number of comments. Try and keep the whole thing nice and tidy if you can. The new post loop looks like this.

[sourcecode language='php']


EXAMPLE THUMBNAIL



[/sourcecode]

Once you’ve pasted in your code you’ll need update your image paths on your icons with PHP, just like we did our blog title image and search submit button. You’ll also need to link your icons to the relivant source, I.E twitter, rss etc… Save your sidebar.PHP file and check your theme in your browser.

Step11

MODIFYING THE FOOTER.PHP FILE

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.

Step12

Paste all your footer code into your footer.PHP file. Save the file then test your theme inside your browser. We’ve now modified some of the main files for our theme, its now time to make a start on some of the other files.

MODIFYING THE SEARCH.PHP FILE

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.

[sourcecode language='php']


[/sourcecode]

Scroll down right to the bottom of your file, just above the get sidebar PHP code add your ending left-content DIV.

[sourcecode language='php']


[/sourcecode]

Head over to your index.PHP file, highlight and copy your post loop to the clipboard.

Step13

Highlight the post loop inside the search.PHP file and hit delete.

Step14

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.

MODIFYING THE PAGE.PHP FILE

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.

[sourcecode language='php']

Read the rest of this page »

‘); ?>

Pages: ‘, ‘after’ => ‘

‘, ‘next_or_number’ => ‘number’)); ?>


‘, ‘

‘); ?>


[/sourcecode]

Underneath the DIV CLASS “post” you need to add our “post-box” class.

[sourcecode language='php']

Read the rest of this page &amp;raquo;

‘); ?>

Pages: ‘, ‘after’ => ‘

‘, ‘next_or_number’ => ‘number’)); ?>


[/sourcecode]

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.

[sourcecode language='php']

Read the rest of this page &amp;raquo;

‘); ?>

Pages: ‘, ‘after’ => ‘

‘, ‘next_or_number’ => ‘number’)); ?>


[/sourcecode]

If you have any pages on your blog, save your work and try them out.

MODIFYING THE ARCHIVE.PHP FILE

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 “have posts PHP”.

[sourcecode language='php']


Archive for the ‘’ Category

Posts Tagged ‘

Archive for

Archive for

Archive for

Author Archive

Blog Archives


[/sourcecode]

Underneath the PHP_the_content tag we need to close our post-box DIV.

[sourcecode language='php']

” rel=”bookmark” title=”Permanent Link to “>


[/sourcecode]

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 “the_time” add a BR tag. Doing this will space out the post abit so it isnt all muggled together.

[sourcecode language='php']

” rel=”bookmark” title=”Permanent Link to “>


[/sourcecode]

MODIFYING THE SINGE.PHP & COMMENTS.PHP FILE

These two files ive left untill last because they are the most fiddly especially the comments.PHP file. We’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.

[sourcecode language='php']


[/sourcecode]

[sourcecode language='php']


[/sourcecode]

We’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.

[sourcecode language='php']

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’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…

[sourcecode language='html']

[/sourcecode]

Take note of the “cols attribute” see how it says 100% we need to change that to 72. So the code now becomes.

[sourcecode language='html']

[/sourcecode]

To align each of the text boxes, underneath each other add opening & closing P Tags either end of the code. After the last P tag add a BR tag.

[sourcecode language='php']

/>

/>

Website

[/sourcecode]

Your comments area should now look something like this.

Step16

The footer could do with being pushed down alittle, open up your style sheet and add “margin-top: 40px;” 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’ll try and use the ones all ready made. Add these styles into your style sheet.

[sourcecode language='css']
.float-right {
float:right;
}

ul, ol {
list-style:none;
}
[/sourcecode]

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.

[sourcecode language='php']

to &amp;#8220;&amp;#8221;

    id=”comment-“>

    comment_approved == ’0′) : ?>

    Your comment is awaiting moderation.



    [/sourcecode]

    Change post-box from post-box to post-box2 and change post-footer to post-footer2. Now paste these styles into your style sheet.

    [sourcecode language='css']
    .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 “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 “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*/
    }
    [/sourcecode]

    While your in your style sheet you can also paste in these styles.

    [sourcecode language='css']
    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;
    }
    [/sourcecode]

    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.

    [sourcecode language='html']


    EXAMPLE THUMBNAIL


    [/sourcecode]

    Delete your exampple thumbnail and replace with this.

    [sourcecode language='php']


    ” title=”“>
    ” alt=”” />


    [/sourcecode]

    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.

    Thats all from me, hope you’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.

Be Part Of The Community!

Become part of the hv-designs community.

Subscribe Via RSS or Follow Us On Twitter.

Subscribe Via RSS Follow Us On Twitter

21 Responses to “BLOOpress WordPress Theme”

  1. It’s very god work
    Thank you very muche

  2. John says:

    Awesome! I love your wordpress conversion tuts. They really help a lot more than others do. Thanks for taking the time to explain things fully. ^_^

  3. yassin says:

    Nice Tut Thank So Much …
    I Wait Next Tut about Coding End Conversion In WordPress …

  4. luke says:

    i was da first to rate

  5. Marius says:

    Great tutorial! So many which only take care of the Photoshop part… Very precise! Thank you! :D

  6. Craig S says:

    Big ups dude, this was very helpful. You’re providing a service that’s really hard to find. Nuff Respec

  7. miniMAC says:

    YOU are A W E S O M E !

  8. Great tutorial thanks

  9. A stunning result!

  10. dzk says:

    iam beginer, i have my www domain name, i have all, and i want my theme and i just cant understund how to make one. this will bee 5th tutorial. lets seeee how goood it will bee this time… i could pay if someone just could mee teach how…dzk@fotoable.com

    at the moment i start reading this one:) ufff

  11. Juls says:

    Nice one! One of the best WP tutorial out there! Well done!

  12. dynallis says:

    Great tutorial! The best tutorial of making a wordpress template :)

  13. Webchester says:

    Nice tutorial, Thanks.

  14. Clayton says:

    i need some serious help on the side bar. it keeps putting it the content way at the bottom of the page. it doesnt seem to keep a consistent format either. PLEASE help

  15. Adobe Photoshop is simply the best photo editing tool on the market. I often use it a lot on my photo studio and also in webpage design |

  16. those who are in the graphics business could never live without Adobe Photoshop.*~~

Leave a Reply