Tag-Archive for » Page «

Capture Visitors’ Attention Through Your Home Page

What made me decide to share with you this articleis the experienceI had when I was working as a part-time freelancer. I remember that whenever I planned the design for websites, I always made it a point that the home page is the most attractive page on the site. I made sure that the home page can capture each viewer that visitsthe site, not only to scan the home page but to enjoy exploring the whole site.

The home page is the page that loads when the Home button is clicked andusually the first page you see when a website loads.Therefore, it is one of the most important pages on your site. Do you agree?

Look at the image below. If a person wants to be loved,the first thinghe or she will do isto be attractive toget theattention oftheopposite sex. Then, they will find a way to search and know that person well. We know that the first thing a person looks for is the physical appearance, that’s why we are doing almost everything just to look attractive. Haven’t you thought thatthis canalso be applied to web design? If a website wants to get the viewers’ attention, then the physical appearance must also be attractive.

Girl boy

Image by: Camille Joyce Pascual

A home page is also like a teaser

A teaser is one way to advertise, and a homepage advertises too (even a website). A teaser teases viewers that drives them to be curious. A homepage should have this characteristic too. Viewers must be curious the first time they see the homepage and make them explore the whole website.

Image by: trolf

In this article, I will be sharing some of my ideas on how can you let your viewers love your site and tease their eyes by making your home page capture viewers’ attention. But let us know first on what should be the characteristics ahome page must have.

Must-Have Characteristics ofaHomepage

1. Attractive

Every pages of a site must attract viewers. This way, they won’t get bored while visiting each page of your site. But the home page must be more attractive than the other pages of the site because this is the first page your viewers will see. In creating your homepage, you may ask the question, How can I make the home page attractive? The answer to this question is good designing.

Appropriate and Attractive Color Scheme

Colors capture viewers’ attention, especially if they are used in an appropriate manner. If your expected viewers are children, the best colors you can use are the bright ones but make it pleasing to the eyes. If you are designing for a company, then you should choose colors that can give a professional look.

Image by: Elissa Merola

rapid xhtml is one of the websites with very attractive color scheme and still remains to be appropriate for the website. The dominating color, which isWhite plus the nice shade of Bluethey used blended well on theother elements of the sitesuch ash the header, the orange mascot and navigations of the site. It’s very appropriate, clean and professional in look.

Rapidmyxhtml

Creatively Designed Header

Headers also attract people.With modern designing, headers are now becoming very dynamic and really creative. Take a look at the example below.There aredifferent kinds of tools gathered together and on the monitor part, there’s a video clip playing. This is a good concept of telling the audience that the website is related to media such as photography, video, audio, etc.

Blue pixel

Easy-to-Understand Navigation

To capture lots of viewers, you need to have a well-designed navigation. Viewers want everything to be spoon fed on your site, so when they see your navigation they should already understand how it works and so.

Carbonica is one good example that has a well-designed navigation. The designer made a nice concept where the buttons are labeled so that people know on what to expect when they clicked a certain button. Like when clicking the motorcycle button, the page that loads is a calculation ofa motorcycle’s emission.

Carbonica

2. Focused

Home page must focus on its purpose. For instance, if the website advertises a company’s services then the viewers must instantly know what the website’s purpose is. And that is to advertise the company and its services.

Viewers do not want to waste their time thinking on what could be thesite is all about. Instantly, they want to get the informationas soon as the page loads.Like when you are searching for a specific book in a library. If you are looking for a PHP for Dummies book, you don’t want to waste your time going around each section, rather you will justgo to the Computer section of books to find what you are looking for. That’s what viewers expect on each site, and you can already give them an idea on what your website is with your home page.

Shopify did a great job on putting focus on what they do. From the domain name up to the home page, you can already grasp what services the website advertise.

Shopify

3. User-friendly.

One thing that viewers expect on a website is how friendly it can be used. It should provide a comfort and fulfilling time when they explore the site. Many people will say that a home page is just a single page, so it is not important if it is easy to use. I tell you, if the viewer finds it hard to explore the home page then they will just press Alt + F4 or Ctrl + T.

What are the criteria of a user-friendly home page?

Speed

Your home page and other pages must be fast in loading. Or else, your viewers will get disappointed on your site.

Content

There are two things to focus on the content: language and grammar.

In terms of language, English isthe widely usedall over the world. It is veryannoying for viewers when they cannot understand the language you use. If I were to ask, I prefer English to be the language to be used on a website.

There are some people who tend to get annoyed of wrong grammar and leave. So before posting, be sure that the grammar is correct.

Buttons

It should be easy to use and understood by your viewers. Especially in the home page, for this is the starting place of your viewers. So if your buttons are not user-friendly, then they might just leave your page and search for a related one.

Custom Toronto is one of the best examples of site that I find very convenient when exploring. The content is well-written and some information teases you to know more of it, whileits buttons are not complicated to use.

Custom

4. Drives curiosity.

Awhile ago, I have mentioned that the homepage is like a teaser that drives curiosity on your user. I will give you another analogy.The flyers people distribute inside shopping malls offer 70% off on all or certain items. The offer might suit your needs either be it a boutique or a restaurant. If it suits you, you might go.That’s how a home page must work, it should drive the curiosity of your viewers to visit your site andlet themget backnext time.

Curiosity

Image by: Maya Alameddine

Some Tips to Ponder

I have here some tips that can help you create a captivating home page. To give you comfort in reading, I have categorized each tips based on the elements to be found on a home page.

1. Do not be a spoiler

Home pages are intended to tease viewers,and will have the move to explore. Do not spoil them by puttingall information they needon the homepage.

2. Attract

Attract to get their attention by:

Choosing a good background. You can use an image, or a graphic for your background or you can also leave it plain and simple.See the websites below as an example.

Viget

Viget inspire

Free People Clothing Boutique

Free people

Twelve Restaurant

Twelve

Electricurrent

Electricurrent

IL FRUTTETO

Il frutteto

Putting an appropriate color. Choose a color that represents what you advertise. Justmakesurethe shade of the color you chooselooks professional and pleasing to the eye.

I’ve searched for the meanings of each colors and found these on the internet:

Red: action, confidence, courage, vitality

Pink: love, beauty

Brown: earth, order, convention

Orange: vitality with endurance

Gold: Wealth, prosperity, wisdom

Yellow: wisdom, joy, happiness, intellectual energy

Green: life, nature, fertility, well-being

Blue: youth, spirituality, truth, peace

Purple: Royalty, magic, mystery

Indigo: intuition, meditation, deep contemplation

White: Purity, Cleanliness

Black: Death, earth, stability

Gray: Sorrow, security, maturity

Source: Crystal-Cure

You can use the color that represents you or what you promote on your site, so viewers would know what to expect on the site.

Using call-to-action buttons. Usually, call-to-action buttons are seen on the home page. Call-to-action buttons are a great way to force your viewers to click that button. Take a look at the image below, Wufoo has a great call-to-action buttons by making them noticeable and forceful.

Wufoo

Adding appropriate images and graphics. Images can give your viewers an idea or information regarding your content. You can place images for them to better understand what you wish to convey. Graphics can also represent your content and attracts the eyes of your viewers especially when they are colorful.

Mc Donalds

Mc donalds

Fender

Fender

Designing your navigations as easy to understand. Navigations are viewers’ way to search on your website. Make sure from the home page up to the last site page your navigation is similar, very easy to use and

Sohtanaka

Sohtanaka

Fall in Tennessee

Fall in tennessee

MaAllan Ridge

MacAllan

Writing a relevant information. Information is very important for viewers, even if this is the last thing they notice. Puta relevant information about what you would like your viewers want to know regarding your site. Makeyour contentas brief and precise as possible for viewers hate to read very long paragraphs.

When creating a content, make sure the following are met:

  • Your headline is very catchy.
  • Use words that are pleasing to the ears.
  • Be creative in choosing words, and make surepeople understand the terms you use.
  • Your words are spelled correctly.
  • The content is grammatically correct.
  • Your content is relevant to what you want to express.

Focus on your subject.

These questions can help you to decide on what to put on your home page:

  • What isyour purpose?
  • Whoyou are?
  • What are your goals?
  • What doyou want to convey?

Just focus on what you intend to show and convey on your home page.

WrappingUp

There you go. Creating a catchy home page is not that difficult. You just need to:

  • Know the basic of designing.
  • Be appropriate.
  • Be creative to be attractive yet remains to look professional.
  • Focus on what your website is.
  • Do not spoil them through your home page. Tease.

I hope this article can help you a lot in creating your home page to attract your viewers. Feel free to put some comments below :)

How to Create a better FAQ page for end users

FAQ (Frequently Asked Question) pages have become commonplace on many websites for many reasons. The main, is that they offer a way to provide support, most commonly, customer support, without having to re-iterate solutions to common problems. For larger companies, a good FAQ page can even have an effect on the amount of support staff that are needed to be hired, yet browsing the internet, I continually find FAQ pages to be neglected, and a navigational nightmare. Similarly,Googlefor some articles on FAQ page design, and you’ll find near to nothingthat’shelpful.

While designing a recent project in Photoshop (a software sales theme), I decided the support area was something I wanted to get right, with the focus falling heavily on the FAQ page. I wanted to get a feel for how I wanted it to work, and so I got thinking; What is it that the end-user wants when they arrive. I came up with these thoughts,

  • Ease of reading – the hierarchy of the text needs to bedistinct
  • Organization – questions should be split intocategories
  • Navigation – finding their way to the information they want should be made easy, and quick

With these three points in mind, I came up with a tidy, and importantly clean FAQ page concept, the demo of which can be found below. I’m going to talk you through how it was made, and teach you how to build it yourself.

Click this link for a demo of the FAQ page we are going to make. You can also download the source code here.

Tutorial Requirements

This tutorial assumes you are fairly comfortable using the following languages

  • Html
  • Css
  • jQuery

Step 1 – Structuring our Html

Our html is split into two main sections. Within our wrapper, we have a primary column, and a sidebar column.

<div id="wrapper">
	<div id="primary></div> <!-- Main content column -->
	<div id="sidebar"></div> <!-- Sidebar Column -->
</div>

The primary content column is where we are going to split our questions into simplecategories. Each category will have a title, a list of the questions with links, and then the questions split up using a definition list. The markup we are looking for goes like this. (This shows a category with two columns)

<h3 id="1">Lacus pulvinar
<ul class="section_menu">

	<li><a href="#1_1">Lectus massa adipiscing, mattis. Turpis integer massa.</a></li>

	<li><a href="#1_2">Integer enim montes mauris, arcu est.</a></li>
<!--<span class="hiddenSpellError" pre=""-->ul>
<dl class="faq">
	<dt id="1_1">Lectus massa adipiscing, mattis. Turpis integer massa.</dt>
	<dd>Ultricies in mus, magna rhoncus augue, nec magnis facilisis integer ut pellentesque aliquam sit! Enim odio, porta augue, sed turpis dolor ultrices porttitor arcu massa cum elementum hac in vel, magna magnis, enim scelerisque? Amet aliquam, magna dis porta platea. Cras aliquet. Arcu mid eros aenean parturient cras ac egestas tempor? Lundium parturient dapibus, ridiculus ridiculus dapibus! Quis eros amet.</dd>
	<dt id="1_2">Integer enim montes mauris, arcu est.</dt>
	<dd>Et ridiculus vut dis vel integer pid? Adipiscing nec tristique dictumst tristique duis rhoncus sed, scelerisque. Porta, diam augue vel augue porta enim. Et! Tristique montes. Auctor! Pid tristique purus montes. Quis? Sit, enim. Egestas! Tristique amet mattis adipiscing, proin elit adipiscing integer! Enim, odio. Etiam ac, nunc est purus turpis. Nunc! Pid cras scelerisque mid habitasse. Cum magnis.</dd>
</dl>

It is important that you match up the navigational links for each category of questions with their ID’s. Notice that the first question in this category has an id of “1_1″, and the link the first question has a href of that id. This is important in solving our navigational problems for the user.Similarly, notice that the category title has a numerical id, to show that this is the first category. These id’s need not be numerical, they can be whatever you want, as long as they are unique to the category / question.

Moving onto the sidebar, this is where navigating the bigger picture comes into place. We’ve linked up out category questions, but how to users navigate to the categories themselves? Through the sidebar is how.

Within the sidebar, we are going to include a header, and another navigational menu linking to our categories. You can build upon, this of course, and add whatever you want to your sidebar, possibly a quick contact form, or support contact details.

<div id="sidebar">
	<h3>Select Category</h3>
	<ul class="section_menu">

	<li><a href="#1">Lectus facilisis vel</a></li>

	<li><a href="#2">Vut magna</a></li>

	<li><a href="#3">Lacus pulvinar</a></li>
	</ul>
</div>

Step 2 – Creating our layout and typography with Css

First off, we want our FAQ page to look universal in all browsers, so as always we will apply a css reset. We also want the FAQ page to be easily readable, and look stunning yet simple. For this I’ve used a modified version of the text.css that comes with 960.gs, instead using Myriad Pro, and Helvetica as our fonts. Since this section of css is large, and very basic, you can copy and paste it from here.

Starting off with our basic styles, we are going to create our layout columns, and center our page in the middle of our window.

/** Center our page in the middle of the window **/
div#wrapper{
	width:960px;
	margin: 0 auto;
	position:relative; /** Important later on **/
}

/** Give our primary column a width and float it to the left width a right margin **/
div#primary{
	width:720px;
	margin: 20px 40px 0 0;
	float:left;
	display:inline;
}

/** Position our sidebar to the right of the primary content bar **/
#sidebar {
  	left:760px;
  	position: absolute;
}

You’ll notice that we have absolutely positioned our sidebar rather than float it to the left of our primary content column. This is important for something special we are going to do with our sidebar later on.

Now it’s time to start adding some subtle styling to our page content to bring it up to standard and make viewing it extra eye pleasing. We’ll start off with two basic styles on our h3 and a tags.

/** Give our category headers room to breath **/
h3{
  	padding-top:30px;
}

/** Color our links blue **/
a{
	color:#0986e3;
	text-decoration:none;
}

/** Add a hover effect to links **/
a:hover{
	text-decoration:underline;
}

You’ll have noticed some of the class names I dropped into the html when we created it. These include section_menu and faq. They’re used to style our navigational menus (sidebar included), and our questions themselves.

/** Styling the navigational menus by adding a subtle background, and padding **/
ul.section_menu{
	background:#ededed;
	padding:20px 10px;
}

/** Style our faq questions **/
dl.faq{
	margin-bottom:30px;
}

/** Make the question itself stand out **/
dl.faq dt{
	font-weight:bold;
	color:#000000;
	padding:25px 0 5px 0;
	display:block;
}

/** Add a divisor below the question answer **/
dl.faq dd{
	padding-bottom:25px;
	border-bottom:1px solid #cccccc;
	display:block;
}

Step 4 – Creating a static sidebar with Jquery

Now we are going to start using Jquery toimprovethe usability of our page. Currently it looks nice, and works well for a page without any javascript, but we can make it so much better! Start by including jquery in the had of your page. We are going to load it directly from google.

<script><!--mce:0--></script>

Secondly we are going to add slightly the html of our sidebar. Add another div wrapping all the content of your sidebar. In our case, I’m going to give it an id of “sidebar_content”.

<div id="sidebar">
	<div id="sidebar_content">
		<!-- Sidebar content in here -->
	</div>
</div>

We also need a bit extra css, and css for our sidebar for when it becomes fixed.

/** Position our sidebar content at the top of our sidebar, and give it the width of the full sidebar **/
#sidebar_content {
  	position: absolute;
  	top: 0;
  	margin-top: 20px;
	width:200px;
}

/** When the sidebar becomes fixed, it'll fix to the top of the page **/
#sidebar_content.fixed {
  position: fixed;
  top: 0;
}

You may not understand the fixed class yet, but the following Jquery will help clear that up for you. Create a script tag in the head of your document, below, the Jquery we are loading from Google, and insert this code.

$(document).ready(function () {
	var sidebar = $('#sidebar_content');
	var top = sidebar.offset().top - parseFloat(sidebar.css('marginTop'));
	$(window).scroll(function (event) {
		var ypos = $(this).scrollTop();
		if (ypos >= top) {
		sidebar.addClass('fixed');
		}
		else {
			sidebar.removeClass('fixed');
		}
	});
});

This may look daunting if you’ve never touched Jquery before, but don’t worry, we’ll step through it line by line. We start off with the Jquery basic of when the document is ready, run this code. The create two variables.

	var sidebar = $('#sidebar_content');
	var top = sidebar.offset().top - parseFloat(sidebar.css('marginTop'));

Our first variable, “sidebar”, assigns the variable sidebar, with the selector pointing to our inner sidebar div. We called it “sidebar_inner”, but you may have called it something different.

Our second variable, top, calculates the distance of the sidebar from the top the top of the page, minus any top margin that we have applied.

$(window).scroll(function (event) {
	var ypos = $(this).scrollTop();
	if (ypos >= top) {
	sidebar.addClass('fixed');
	}
	else {
		sidebar.removeClass('fixed');
	}
});

This snippet of code starts off by saying, if the window is scrolled, carry out this code. I starts again by creating another variable by calculating how far from the top of the page we are, and assigning it to the variable “ypos” (position on the y-axis).

We then enter an if statement, that says: If the distance to scroll to the top is greater than the distance that the sidebar is from the top, give it to class of fixed. If not, don’t give it the class of fixed. This is where the fixed class we created earlier on comes into play. Easy huh? =)

Step 5 – Making a smooth page scrolling effect

So we have a lovely fixed sidebar as we scroll, without the traditional glitchy jumping that used to be commonplace with fixed sidebars, but out internal page linking still jumps directly to the destination, and while this is good, it isn’t very eye pleasing, so we are going to add an animated page scroll. Since the jquery to achieve this is too complex for us to hand write, we are going to use a plugin called localScroll, and another called ScrollTo for our animation. Download them both from here, and include them in the head of your document again, this time between our Google hosted Jquery, and our custom written Jquery.

<script src="jquery.scrollTo-1.4.2-min.js"></script>
<script src="jquery.localscroll-1.2.7-min.js"></script>

The implementation of this is stunningly easy. Simply add to our custom Jquery this one line of code.

$.localScroll();

Note : Make sure you place this line of code within the jquery wrapper,

$(document).ready(function () {
	// Somewhere in here!
});

And there you have it! A fantastically usable, and simply beautiful FAQ page that means the user can easily navigate between categories and questions, without having to spend ages scrolling through search pages, and loading page after page for different categories, or even clicking to open a single question.

Further Discussion

Have some thoughts on the usability of this page? Give them to me, I’d love to hear them. This is as much a proof of concept as it is a tutorial introducing you to basic html, css, Jquery, and plugins, but I’m sure there will be people out there who will feel a perfect FAQ page is something else. If so, what would you do?

Customize Your Facebook Fan Page: Tips, Tricks, Applications

Customization will always make you stand out from the rest of the world, the same rule applies on Facebook as there are more than 400 million active users.By now you may be well aware of Facebook fan page which is used for promoting business online on Facebook. But just creating a simple fan page won’t help you get the fan following you want. With this article I will be sharing with you some of the most basic tips that you can implement right away & customize your fan page within few minutes, using some applications and codes.

Static FBML

An application which should be implemented by most of the fan-page owners. Static FBML is really simple to implement and can be used to do various modifications on Facebook Fan Page. FBML supports pure HTML & CSS.

We will use Static FBML to create customized Fan page for Facebook.

Adding FBML To Fan Page

  1. Login to your Facebook account & Search for Static FBML
  2. Then click on the tab Add to My Page & Select the page.

Now we will add some code that will transform your fan page completely.

Creating Landing/Welcome Page

Landing or Welcome Page is the first page you see when you visit a new fan page encouraging user to click on the Like button. Creating a Landing page really simple & I will share the step by step guide on how you can do it easily.

In previous step you have already installed the Static FBML application now you need to create a welcome page image that will encourage users to click on the like button. You can do it easily in Photoshop or any similar applications.

When creating the image “Do remember that image’s width should be of 520px” the height does not matter but it would be good if you keep it of appropriate length.

1.Create an image with width 520px & appropriate height in Photoshop or similar application.
2.Create a folder name FB at your server & upload the image in that folder.
3.Now Navigate to your fan page & click on Edit Page tab below the Fan Page’s Profile Image.

Customising Facebook Fan Page 4.Locate your FBML application & click on Edit.

Customising Facebook Fan Page

5.Now you will see a similar window like the image below.

Customising Facebook Fan Page

6.Now add an appropriate title like Welcome or your blog name anything you prefer.

In FBML part just add the following code.

<img src =”http://yourwebsite.com/FB/imagename.jpg”>

If you want to add link to the image just add the following code

<a href=”http://yourwebsite.com”>

src =”http://yourwebsite.com/FB/imagename.jpg”>

</a>

You can also use text after the image with some HTML tags like h1, h2,

, etc as done in 1st Web designer Facebook fan page.

7.Once you are done click on save changes & now navigate to your Fan Page you will see a new tab with the title you have written, by clicking on that tab you will see your image in that page.

Customising Facebook Fan Page8.Now to set your new page as default landing page you need to click on the edit page tab as we have done in step 3 & locate wall settings then set your default landing page to new page.

Customising Facebook Fan Page

You are all done with creating a new & improved version of your fan page. We will add some more code to fan page to make it more personalized so keep reading further.

Adding Subscriber Form to Fan Page

If you use feedburner to manage your feeds you can easily add subscriber form to your fan page by getting the code under the Subscription management in your feedburner account.

Customising Facebook Fan Page

Now navigate to your FBML application and then click on edit & then click on add another FBML box.

Customising Facebook Fan Page

After adding the FBML box, enter title subscribe & paste the code from the feedburner into that box & now you are all done.

If you want that box to be appearing in the sidebar or the wall just click on the tab & select move to wall tab & then it will be appearing on your fan page’s wall. Similarly you can add contact form to the fan page as well.

Other Useful Articles About FBML

How to Add Google Analytics to Your Facebook Fan Page

7 FBML examples to rock your Facebook fan page

How to Put a Contact Form in a Facebook Fan Page

Applications for Customizing FaceBook Fan Page

If you are not comfortable using FBML, then still you can customize your fan page using various applications. This application makes easier to share photos, Videos, Files, Twitter updates & lots of other stuff depending on your needs. There are large number of applications that will help you with your fan page. Below are some of the effective applications that will help you get your work done easily.

Clobby – Group Chat

Clobby Group Chat - Fan Page Application

This is really useful application if you want to integrate live chat room to your fan-page. It is free application & allows users to create chat rooms & invite other friends to chat. It is great way to encourage users of the page to communicate with each other & increase the level of interactivity of the page.

ShopTab

ShopTab - Facebook Fan Page Application

If you sell products online then ShopTab is perfect application for you to showcase & sell you products through fan-page. ShopTab is premium application so you need to pay monthly charges.

Involver

Involver Facebook Fan Page Application

Involver provides professional application for your Facbook Fanpage which you can install with a single click. The involver has large application gallery which has RSS Feed, Twitter, YouTube Channel, Photo Gallery & many more applications. With the free account you can install only two applications.

Tigerlily

Tigerlily CMS - Facebook Fan Page Application

Tigerlily application is easy to implement & its has content management systems of its own which is easily controlled from fan-page. In Tigerlily CMS free version you can easily add different modules like text editor, video, image, twitter, RSS Feed, MP3 player, flickr & podcast.

Poll Daddy

Poll Daddy Polls Facebook Fan Page Application

With Poll Daddy application you can create polls which you can share it on your fan page to get feedbacks from the users & increase their participation on the fan page.

Hope you found the post useful & informative, If you have other useful applications or FBML tricks to share then feel free to mention them in comments.

Get Inspired: 35+ Hand Picked Facebook Fan Page Profile Images

Facebook FanPage Image & Applications to Enchance Your PageNow a days more people are considering social media as a serious way to market their products & services. People have been using twitter for marketing & now they are turning towards Facebook. Engaging Facebook user is bit difficult & different, but there are several ways to get attention and support from users of Facebook one of them is using eye-catching images.

On Facebook you can use image which is 200px width and 600px height as your profile & fan page image. Some users, use their logo as the fan page image & some get creative with the image which provides information along with their logo. Here I am sharing some creative as well as simple fan page images for you to get inspired & try something differently.

1.1st Web Designer

1st Web Designer - Facebook FanPage Image

2.Design Informer

Design Informer - Facebook FanPage Image

3.Mashable

Mashable - Facebook FanPage Image

4.Front End Design

Front End Design - Facebook FanPage Image

5.iDesign Studio

6.Naldz Graphics

7.Pushing Pixels

8.Inspired mag

9.Addidas

10.The Home Depot

11.Gap

12.Design Reviver

13. Social Blade

14.PVM Garage

15. The Web Blend

16.Axet.net

17. Think Geek

18.Go Media

19.Hongkiat

20. Social Media Examiner

21.A List Apart

A List apart - Facebook FanPage Image

22.My Ink Blog

My Ink Blog - Facebook FanPage Image

23.John O’Nolan

John O'Nolan - Facebook FanPage Image

24.Cartoon Illustration

Cartoon Illustration - Facebook FanPage Image

25.Brian Joseph Studios

Brian Joseph Studios - Facebook FanPage Image

26.Specky Boy

Specky Boy - Facebook FanPage Image

27.Wired

Wired - Facebook FanPage Image

28.Blonde 2.0

Blonde 2.0 - Facebook FanPage Image

29.We Blog Better

We Blog Better - Facebook FanPage Image

30. Digital Art

Digital Art - Facebook FanPage Image

31.PSD Valut

PSD Valut - Facebook FanPage Image

32.Freelance Switch

Freelance Switch - Facebook FanPage Image

33.Dolce & Gabbana

Dolce & Gabbana  - Facebook FanPage Image

34.Sony Ericsson

Sony Ericsson  - Facebook FanPage Image

35.StarBucks

StarBucks  - Facebook FanPage Image

36.Atlantis

Atlantis - Facebook FanPage Image

37.McDonald

McDonald - Facebook FanPage Image

38.BlackBerry

BlackBerry - Facebook FanPage Image

Which one was your favorite? If you have other Fan Page images to share then feel free to mention them in comments.

Thumbnail by Henry Han

How To Create An Options Page For Your WordPress Theme

WordPress is one of the most popular Content Management Systems. Also WordPress isa CMS of choice for many web developers Its relatively easy to use, but can be made even simpler when you include an administration panel for users when making themes. Additionally, themes buyers find the options panel too easy to use rather than having to open up the PHP template files and fiddling with the code.

Today we will be incorporating an options panel for the WordPress Classic theme. The methods you will learn will allow you to very easily integrate it into an existing theme youre working on.

Setting The Files :

The theme that we will be working on is the classic theme provided by wordpress. You can find it on wp-content/themes folder. You should see the following files:

  • index.php
  • functions.php
  • comments.php
  • footer.php
  • header.php
  • rtl.php
  • sidebar.php
  • style.css
  • screenshot.png
  • An images folder with two files

Most of our work will be done within the functions.php file.

Now go to your wordpress admin panel then go to Appearance>Themesand activate the classic theme.

Working on functions.php :

Begin by opening up functions.php in your code editor of the classic theme (wp-content/themes/classic/functions.php) then insert the following code :

<?php
$themename="Classic Theme";
$shortname="ct";

I added two variables the first one reffers to the name of the theme and the second is the shortname : You can choose any name for these two variables but don’t forget to select significant names because you will be using them later.

Now let’s start adding some options for our theme :

$options = array (
 array( "name" => $themename." Options",
       "type" => "title"),
   array( "type" => "open"),
 array( "name" => "Color Scheme",
           "desc" => "Select the color scheme for the theme",
       "id" => $shortname."_color_scheme",
           "type" => "select",
       "options" => array("blue", "red", "green"),
       "std" => "blue"),
 array( "name" => "Logo URL",
       "desc" => "Enter the link to your logo image",
       "id" => $shortname."_logo",
       "type" => "text",
       "std" => ""),
 array( "name" => "Homepage header image",
       "desc" => "Enter the link to an image used for the homepage header.",
       "id" => $shortname."_header_img",
       "type" => "text",
       "std" => ""),
 array( "name" => "Footer copyright text",
       "desc" => "Enter text used in the right side of the footer. It can be HTML",
       "id" => $shortname."_footer_text",
       "type" => "text",
       "std" => ""),
 array( "name" => "Google Analytics Code",
       "desc" => "Paste your Google Analytics or other tracking code in this box.",
       "id" => $shortname."_ga_code",
       "type" => "textarea",
       "std" => ""),
    array( "name" => "Feedburner URL",
       "desc" => "Paste your Feedburner URL here to let readers see it in your website",
       "id" => $shortname."_feedburner",
       "type" => "text",
       "std" => get_bloginfo('rss2_url')),
    array( "type" => "close"));

Here the variable “option” contains a big array which also contains other child arrays. Each child array holds an option.

The first array reffers to the title of the page ( In our case it’s ‘Classic Theme Options’ ). Every time when we want to add a new option we have to declare an array with a type and give it the name we want.

You can take a look at the options specified below :

  • name: The name of the input field.
  • desc: A short description explaining what it is to the user.
  • id: the id of the field, prefixed by the shortname. It will be used to store as well as access the options.
  • type: the input type select, text or textarea
  • options: used to declare an array of options for a select type input.
  • std: the default input value, used if no other input is given.

Now we have our options ready but how can we view them ? Add the following pieces of code to the functions.php file:

function mytheme_add_admin() {
global $themename, $shortname, $options;
if ( $_GET['page'] == basename(__FILE__) ) {
if ( 'save' == $_REQUEST['action'] ) {
foreach ($options as $value) {
update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
foreach ($options as $value) {
if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
header("Location: themes.php?page=functions.php&saved=true");
die;
} else if( 'reset' == $_REQUEST['action'] ) {
foreach ($options as $value) {
delete_option( $value['id'] ); }
header("Location: themes.php?page=functions.php&reset=true");
die;
}
}
add_menu_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'mytheme_admin');
}

Here I declared a function with a name of “mytheme_add_admin”. This function is used for updating options : If the options are saved, then all the options are updated with their new values. If the options are being reset (indicated by another hidden variable with a value reset), then all of the options are deleted. The last line adds a theme page( add_theme_page ) in Appearance box and it calls mytheme_admin function. If you want you can replace add_theme_page with add_menu_page to create an external box :

At this step we still don’t have the theme options page, so we have to write mytheme_admin function which was called by add_theme_page, add this code to functions.php :

function mytheme_admin() {
global $themename, $shortname, $options;
if ( $_REQUEST['saved'] ) echo '<div id="message"><p><strong>'.$themename.' settings saved.</strong></p></div>';
if ( $_REQUEST['reset'] ) echo '<div id="message"><p><strong>'.$themename.' settings reset.</strong></p></div>';
?>

Here we have some conditions : if the settings are saved WordPress will show ” Classic theme settings saved “. Likewise for reset.

Now paste the code above I will explain it after :

<div class="wrap">
<h2><?php echo $themename; ?> Settings</h2>

<form method="post">

<?php foreach ($options as $value) {
switch ( $value['type'] ) {

case "open":
?>
<table width="100%" border="0" style="background-color:#cdcdcd; padding:10px;">

<?php break;

case "close":
?>

</table><br />

<?php break;

case "title":
?>
<table width="100%" border="0" style="background-color:#868686; padding:5px 10px;"><tr>
<td colspan="2"><h3 style="font-family:Georgia,'Times New Roman',Times,serif;"><?php echo $value['name']; ?></h3></td>
</tr>

<?php break;

case 'text':
?>

<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><input style="width:400px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>

<?php
break;

case 'textarea':
?>

<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><textarea name="<?php echo $value['id']; ?>" style="width:400px; height:200px;" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?></textarea></td>

</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>

<?php
break;

case 'select':
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><select style="width:240px;" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select></td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>

<?php
break;

case "checkbox":
?>
<tr>
<td width="20%" rowspan="2" valign="middle"><strong><?php echo $value['name']; ?></strong></td>
<td width="80%"><?php if(get_option($value['id'])){ $checked = "checked="checked""; }else{ $checked = "";} ?>
<input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
</td>
</tr>

<tr>
<td><small><?php echo $value['desc']; ?></small></td>
</tr><tr><td colspan="2" style="margin-bottom:5px;border-bottom:1px dotted #000000;">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>

<?php break;

}
}
?>

<p class="submit">
<input name="save" type="submit" value="Save changes" />
<input type="hidden" name="action" value="save" />
</p>
</form>
<form method="post">
<p class="submit">
<input name="reset" type="submit" value="Reset" />
<input type="hidden" name="action" value="reset" />
</p>
</form>
</div>

Explanation :

With this code we created our options page content : I used a php foreach loop, each option type is evaluated on a case-by-case basis. So if the type of the option is title do this, if it is a checkbox do that…

If there is an open type option we do nothing. If there is a close type options, we close our table. For each of the types text , select , checkbox and textarea , we display the corresponding input. At the end we added two buttons one to save the settings and the other to reset them.

Now our options page is ready, but we have to add this short code to make it work :

<?php
}
add_action('admin_menu', 'mytheme_add_admin');
?>

This short code tells WordPress to add the admin menu.

After all this, here the result you should end up with :

In this example I used simple styles included in functions.php to make our options page looks better but I will show you how to add a stylesheet to functions.php so you can add your styles rapidly.

How to add a stylesheet to functions.php :

First, you have to create a new folder on your theme folder, name it functions then create a new css file with a name of functions.css. After flling your css file add this code to functions.php after mytheme_add_admin function :

function mytheme_add_style() {
$file_dir=get_bloginfo('template_directory');
wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");
}

That adds the functions.css file to the head. The location of the file is determined by the template directory.

Also, if you want you can use scripts to make your options page better by including a js file.To do this you have to change

wp_enqueue_style("functions", $file_dir."/functions/functions.css", false, "1.0", "all");

To :

wp_enqueue_script("script", $file_dir."/functions/script.js", false, "1.0");

After adding your stylesheet or your script, you have to add this code underadd_action(‘admin_menu’, ‘mytheme_add_admin’); so they will be active :

add_action('admin_init', 'mytheme_add_init');

Making Use of the Options :

Now after creating our options, I will show you how to make use of them.First up, open up your header.php file, and add the following code:

<?php
global $options;
foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
}
?>

You must put the code above at the start of all the files which you add options to. Once youve done that you can begin using your options. For example : If you want to display the footer text you have to echo $ct_footer_text ( ct reffers to the shortname of the theme ) :

<?php
echo $ct_footer_text;
?>

For a checkbox you can check if the box is checked ( it will return true ) do this…

You can download the functions.php file here.

That’s it ! Thanks for reading this tutorial and I hope it was useful.