Tag Archives: customizing


Exposure Photography Splash Page

January 31st, 2011 by

Exposure Photography Splash Page - By Robert Heck

Client Friend: Jason Talley
Website: http://www.exposurebyjtalley.com
Site Features:

Info: Jason had done my engagement photos and then wedding photos and since then we’ve talked off and on about SEO help he needed as well as web advise. He came to me wanting to get a splash page to link his blog, online portfolio(still pending), and client photos. At first it was going to be just basic HTML/CSS but after shooting around some of my “wouldn’t it be cool” ideas we agreed on some PHP to help make the splash page easier for Jason to update images as well as keep the code on the website changing a little bit for SEO purposes. After a few issues with hosting and domain changes as well as some issues where I couldn’t see the site to make some final changes but it is finally up.


Wealth 4 Life Global Enterprises Inc.

January 13th, 2011 by

Wealth 4 Life Global Enterprises Inc. designed by Robert Heck
Client: William Byron Austin
Website: http://incomegeneratingideas.com
Site Features:

  • XHTML Coding
  • PHP/Javascript Contact Form
  • CSS Styling
  • Flash/jQuery MP3 Player
  • Youtube Video
  • W3C Valid Coding

Info: A splash page that I built for a client of Business Development Institute. The Content was provided by the client.


Photo Excerpt WordPress Theme Sneak Peak

January 7th, 2011 by

I decided to post a sneak peak of the wordpress theme I’m working on for distribution as it isn’t quite as “quick and easy” as I first thought. Well to be honest I came up with more features I thought should be included by default.

That being said here’s a preview of how the posts will appear on the home page:

Wordpress Photo Excerpt Theme by Robert Heck

If there is no image in the post it will show a question mark. If there is a picture in the post it will scale it down a bit and put it in the gray area instead of the question mark. If there are several pictures in a given post it will grab the first image of the post.


Tutorial – Using Binary to Alternate Class/ID Names

January 6th, 2011 by

In this tutorial I will show you how to use a PHP check to test weather or not a number is odd or even. This will then be used to load different class/ID names so that different CSS can be applied. This is a great tool to alternate code that is being run through a loop, for example WordPress posts on the main page.

Here’s all the code that is needed:

  1. <?php $i = 0; ?>
  2. <!– Part 2 –>
  3. <?php $i++; ?>
  4.                 <div <?php if($i & 1) { echo ‘class="name01"’;} else {echo ‘class="name02"’;} ?>>

Now the first thing you’ll notice is I have the code separated into 2 parts. The reason for this is because the code will have to exist in 2 different parts.

  1. <?php $i = 0; ?>

This will set the default value for $i. It needs to go outside of your loop because if you were to put it into the loop you’d always reset the value.

Now lets look at the rest of the code that will inside of your loop:

  1. <?php $i++; ?>
  2.                 <div <?php if($i & 1) { echo ‘class="name01"’;} else {echo ‘class="name02"’;} ?>>

The first thing we’re doing is incrementing $i by one number, this will go up every time this is triggered by the loop. Lets say your loop runs 3 times then $i will go like this: 0 > 1 > 2 > 3.

Now the next line of code is comparing $i to 1 and then will give the div the class name based on weather or not the match is true. Now you’re probably thinking it will only work when $i is 1 but what it is doing is comparing the match in binary. Here’s what some of the numbers look like in binary:

0 = 00000000
1 = 00000001
2 = 00000010
3 = 00000011
4 = 00000100

what “$i & 1″ is actually looking for is if the 2 numbers in binary form ever have a matching number. So for 0 > 1 > 2 > 3 it would actually look like this:
0 & 1:
00000000
00000001
———-
No match

1 & 1:
00000001
00000001
———-
Match on last digit

2 & 1:
00000010
00000001
———-
No match

3 & 1:
00000011
00000001
———-
Match on last digit

So that is how it knows which number is odd and which one is even. And that is how you can make alternating class/ID names with PHP.


Tutorial – Building a Website Part 1

December 28th, 2010 by

I’ve decided to go back to the basics with this next series of tutorials and start from the very beginning.  In this tutorial you will be learning how to use XHTML and CSS to build a simple web page.

The first thing is picking a text editor. I recommend Notepad++ as it is free and supports several different format options for various languages, including HTML/XHTML and CSS.

You might be thinking “why XHTML and not HTML if this is the basics”?
I feel that XHTML is a much cleaner way to build a website that will help with browser compatibility, layout readability, as well as reduce the risk of errors and help in spotting them.

This time around I won’t be showing you all the code in the beginning as I will be writing it out as I go through the different sections of the code. There are 2 sections that are needed to build a good website, the Header and the Body.
- The Header will contain all the information a browser and search engines will need to properly parse your code.
- The Body will contain the code that will be displayed visually as your website.

As this will be the first page of your website it must be labeled: index. As XHTML is a variation of HTML we will be using index.html, so create the file. If you’re using Notepad++ just click File > New and label the file index.html.

So lets get started with the head. There are a few things we’ll need to define:
- Document type.
- What code language we’ll be using.
- What character set we’ll be using.
- Link to the style sheet of the website.
- A Descriptive Title.

So now lets get started by defining the document type:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

This needs to be the first line of code on your webpage so that browsers know what to treat the file as when they are displaying it. You’ll notice that it is being set to “XHTML 1.0 Strict” this leaves little room for error.

Lets move on to starting the HTML portion of the website now that we’ve described what the document type.

  1. <html xmlns="http://www.w3.org/1999/xhtml">

Even further confirmation of the exact HTML language type.

Now lets start the head section by defining what character set our website will be using. This is important as it will definite what kind of characters/symbols will be used, it also tells browsers in other countries to use a different character set than the one they default to, this ensures your website will display correctly even in other countries.

  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Now before we close the head section lets add a link to the css file we’ll be using as well as the title of the page.

  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  3. <link rel="stylesheet" href="css/style.css" type="text/css" />
  4. <title>Cool Title Goes Here</title>
  5. </head>

That about covers the basics of the head section of a website.
Oh and if you’re wondering why I am putting the css sheet in a folder called css, I feel it is good practice to be consistent with all your web designing folder structuring. It prevents you or others looking into the directory from getting confused.

  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  3. <title>Good Website Title Goes Here</title>
  4. </head>

Now that we’ve finished the head lets move on to the body section. Before I get into the code I’m going to show you the simple layout I’ll be using to make the website. Keep in mind it is best to finalize the design of your website layout to prevent having to recode large parts of the website if you come up with something that doesn’t work with what you’ve coded.

Sample Website Layout - Created by Robert Heck

There is a section for the header, a sidebar, the main content, and the footer. All typical parts of websites.

Now that we know the layout of the website lets break it up into divs.


In this image I’ve broken down the sections into:
- bodywrap – This holds the rest of the divs.
- header
- centerwrap – This holds the sidebar and the contentwrap.
- sidebar
- contentwrap
- footer

Now if you want you can break them down even further but for now we’ll keep it basic. So lets look at the body code.

  1.    <body>
  2.     <div id="bodywrap">
  3.         <div id="header"></div>
  4.         <div id="centerwrap">
  5.             <div id="sidebar"></div>
  6.             <div id="contentwrap"></div>
  7.             <div class="clearthis"></div>
  8.         </div>
  9.         <div id="footer"></div>
  10.     </div>
  11.     </body>
  12. </html>

I indented the code to give you an idea of how it works each indent indicates it is a div inside of another div. Another thing you’ll notice is that the divs have ID tags that is needed to modify each one uniquely through CSS. I added a div with a class tag “clearthis” which will be explained in the CSS portion.

That’s it for the XHTML. Obviously if you were building a full website you’d fill up each respective section with content but for this tutorial we’re just focusing on the coding and not the content.

Create a new file and call it style.css.

Now lets move on to making this actually look like something visual by using some basic CSS. Lets double check our list of IDs and the 1 class I added, it should look like this:
IDs:
- bodywrap
- centerwrap
- sidebar
- contentwrap
- footer

Class:
- clearthis

Alright now that we have our list ready lets start by adding some styling, starting with the bodywrap:

  1. #bodywrap {
  2.      width:960px;
  3.      margin:0 auto;
  4. }

Note: the “#” is the CSS symbol for ID.
So this is doing 2 things:
- First it says that the bodywrap will be 960px wide, the current accepted standard desktop resolution is 1024×768. When taking into account window borders and vertical scroll bars I’ve found 960 pixels is the magic number that works without forcing a horizontal scroll bar.

- Second it is giving the div a vertical margin of 0 meaning bodywrap will go from the top of the browser to the bottom without allowing any empty space in between. This is also telling the browser to automatically adjust the horizontal margins so the wrap is in the center of the browser.

Now lets move on to give the header, centerwrap, and footer some heights and color so we can see what we’re dealing with in a web browser.
Note: As this is all being coded in XHTML you can view the file localing through your favorite browser.

Now lets add the CSS for these sections right below the bodywrap CSS:

  1. #bodywrap {
  2.      width:960px;
  3.      margin:0 auto;
  4. }
  5. #header {
  6.      height:150px;
  7.      background:#f00;
  8. }
  9. #centerwrap {
  10.      height:350px;
  11.      background:#0f0;
  12. }
  13. #footer {
  14.      height:150px;
  15.      background:#00f;
  16. }

I just picked these heights and colors as an example… feel free to change these as needed. If you’re wondering why I didn’t put a width on these that is because unless otherwise noted a div will inherit the width from the parent div which in all these 3 cases is the bodywrap.

Now lets add the some CSS for the sidebar and the content this will go in between the centerwrap and footer to keep with the order of how the website will display:

  1. #bodywrap {
  2.      width:960px;
  3.      margin:0 auto;
  4. }
  5. #header {
  6.      height:150px;
  7.      background:#f00;
  8. }
  9. #centerwrap {
  10.      height:350px;
  11.      background:#0f0;
  12. }
  13. #sidebar {
  14.      width:200px;
  15.      background:#ff0;
  16.      float:left;
  17.      height:350px;
  18. }
  19. #contentwrap {
  20.      width:760px;
  21.      backgroun:#f0f;
  22.      float:right;
  23.      height:350px;
  24. }
  25. #footer {
  26.      height:150px;
  27.      background:#00f;
  28. }

You’ll notice some things are a bit different now.
- First both have different widths this is because I want them to fit within the defined “960px”, since I want the sidebar to be skinnier I only gave it a width of 200px which left me 760px for the content area.

- Second you will notice I gave the sidebar “float:left” and contentwrap “float:right” what those are doing is telling the respective divs to go all the way to their respective sides. This way the sidebar will appear on the left and the content on the right just like in my simple design layout above.

- Third I gave them both the height of the contentwrap because unlike the width which can be inherited from the parent div the height is actually determined by the content inside of a div if it is not defined.

If you test your page now you’ll probably notice some issues that might have come up, this is because you’ve used “float” which can do cool and bad things to a website if the site isn’t coded wisely. This is where that “clearthis” class comes in. Since the “clearthis” will be a global rule that will not be changed we can define it at the top of the CSS.

  1. .clearthis {
  2.      clear:both;
  3. }
  4. #bodywrap {
  5.      width:960px;
  6.      margin:0 auto;
  7. }
  8. #header {
  9.      height:150px;
  10.      background:#f00;
  11. }
  12. #centerwrap {
  13.      height:350px;
  14.      background:#0f0;
  15. }
  16. #sidebar {
  17.      width:200px;
  18.      background:#ff0;
  19.      float:left;
  20.      height:350px;
  21. }
  22. #contentwrap {
  23.      width:760px;
  24.      backgroun:#f0f;
  25.      float:right;
  26.      height:350px;
  27. }
  28. #footer {
  29.      height:150px;
  30.      background:#00f;
  31. }

You’ll notice I used a period instead of the pound sign, that is because in CSS a period defines a class. I added “clear:both;” what this does is it removes any float left or right that might be above it in the code.

Your XHTML file (index.html) should look like this now:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <link rel="stylesheet" href="css/style.css" type="text/css" />
  6. <title>Cool Title Goes Here</title>
  7. </head>
  8.     <body>
  9.     <div id="bodywrap">
  10.         <div id="header"></div>
  11.         <div id="centerwrap">
  12.             <div id="sidebar"></div>
  13.             <div id="contentwrap"></div>
  14.             <div class="clearthis"></div>
  15.         </div>
  16.         <div id="footer"></div>
  17.     </div>
  18.     </body>
  19. </html>

Your CSS file should look like this:

  1. .clearthis {
  2.      clear:both;
  3. }
  4. #bodywrap {
  5.      width:960px;
  6.      margin:0 auto;
  7. }
  8. #header {
  9.      height:150px;
  10.      background:#f00;
  11. }
  12. #centerwrap {
  13.      height:350px;
  14.      background:#0f0;
  15. }
  16. #sidebar {
  17.      width:200px;
  18.      background:#ff0;
  19.      float:left;
  20.      height:350px;
  21. }
  22. #contentwrap {
  23.      width:760px;
  24.      backgroun:#f0f;
  25.      float:right;
  26.      height:350px;
  27. }
  28. #footer {
  29.      height:150px;
  30.      background:#00f;
  31. }

And that covers the basics of building a website in XHTML and CSS. I hope you’ve found this tutorial helpful. Once you add content to the respective sections you can remove the “height” definitions in your CSS as the divs will used the height of the content by default.


Kelley Pool Repair Inc. Business Website

December 21st, 2010 by

Kelley Pool Repair Inc. designed by Robert Heck

Client: Andy
Website:http://www.kprepair.com
Site Features:

  • XHTML Coding
  • PHP Coding
  • CSS Styling
  • WordPress CMS

Info:Andy came to me with the idea of building a website for the family business as a Christmas present to his father. I went over a couple of ideas with Andy and his sister until we came up with this final layout that they liked. After building the initial mock up in hand coded HTML/PHP/CSS Andy and his sister went over some features they wanted to have added which involved them being able to create/update/delete pages.

They wanted an easy way to do this without having to work around my schedule so I went over a few options and I decided to use WordPress for it. This way they had a simple and easy to use back-end that gave them the ability to create/update/delete posts as they needed and I even built each page through the WordPress back-end so they could change the text on them if they felt the need.