Saturday, March 16, 2013

Developing WordPress Themes Using Responsive Style



Responsive conceive is gradually but surely evolving an expected standard for web developers. This tutorial will display you how to add a responsive structure to your next WordPress topic.
What Is Responsive conceives?

It utilized to be you only had to worry about website consistency over multiple browsers, but now we have to gaze at the bigger image – consistency over multiple apparatus. The computer utilized to be our only gateway to the Internet, but now we leap online from our phones, TVs, tablets and who understands what else will arrive down the pipe. Having your website appropriately render and present on any apparatus should be a peak priority this year.

Responsive design is all about making things fluid and modifying according to screen size. Whereas WordPress doesn’t always play pleasant with responsive design procedures, there are ways it can be achieved. How responsive you decide to make your website is really about how much time you desire to spend doing it.
Responsive structures

there are some responsive frameworks out there to choose from. You might desire to spend some time investigating each one to determine which has the included characteristics your task might require. If you aren’t certain where to start, here are a couple of to consider:

Bootstrap
Bootstrap from Twitter is constructed on a responsive 12 pillar grid. It has included fixed- and fluid-width layouts founded on that system. It furthermore arrives with support for optional JavaScript plug-ins such as a likeness carousel, Typeahead, togglable tabs, and numerous more.

Less Framework
Less Framework is founded on 4 layouts and 3 groups of typographic pregroups. Less structure uses a default layout as a beginning issue and then uses CSS3 newspapers queries to code ‘child layouts’.

Foundation
base is a grid scheme based on 12-columns that do not have a fixed breadth; they can alter based on the tenacity of the screen or size of the window. Base arrives pre-packaged with buttons and constructed in form methods, alerts, and more.

YAML
YAML is a multi-column layout founded on a grid scheme with percentage widths. It arrives with some constructed in characteristics and supports several jQuery plugins such as Accessible Tabs and SyncHeight.

This list of structures is barely entire, but for the sake of this tutorial, I’m going to display you how to incorporate base into your next WordPress topic.
Step 1 Downloading and Applying the Framework

To get started, proceed download base and add the files to your css and js folders in your theme’s book or directions. The easiest way to add the needed documents to your topic would be to use wp_enqueue_script and wp_enqueue_style.

For this tutorial I’m going to display you what you location in your functions.php document to make base work right off the bat, but for more details on supplementing documents this way, check out the tutorial on how to encompass JavaScript and CSS in your topic.

To add the needed JavaScript for Foundation to work correctly in your topic, you need to create a function that calls the wp_enqueue_script to assist them up.

function responsive_scripts_basic()
{
            //register scripts for our theme
            wp_register_script('foundation-mod', get_template_directory_uri() . '/js/modernizr.foundation.js', array( 'jquery' ), true );
            wp_register_script('foundation-main', get_template_directory_uri() . '/js/foundation.js', true );
            wp_register_script('foundation-app', get_template_directory_uri() . '/js/app.js', true );
            wp_enqueue_script( 'foundation-mod' );
            wp_enqueue_script( 'foundation-main' );
            wp_enqueue_script( 'foundation-app' );
}
add_action( 'wp_enqueue_scripts', 'responsive_scripts_basic', 5 );

Next, add the Foundation stylesheets to make the grid flexible. Paste this function after the one you just created.

function responsive_styles()
{
            //register styles for our theme
            wp_register_style( 'foundation-style', get_template_directory_uri() . '/css/foundation.css', array(), 'all' );
            wp_register_style( 'foundation-appstyle', get_template_directory_uri() . '/css/app.css', array(), 'all');
            wp_enqueue_style( 'foundation-style' );
            wp_enqueue_style( 'foundation-appstyle' );
}
add_action( 'wp_enqueue_scripts', 'responsive_styles' );

Once saved, go back and check your source code to make sure your files were added correctly. It should look something like this:

<link rel='stylesheet' id='foundation-style-css'  href='http://thatonegeek.com/sandbox/wp-content/themes/Starkers/css/foundation.css?ver=all' type='text/css' media='all' />
<link rel='stylesheet' id='foundation-appstyle-css'  href='http://thatonegeek.com/sandbox/wp-content/themes/Starkers/css/app.css?ver=all' type='text/css' media='all' />
<script type='text/javascript' src='http://thatonegeek.com/sandbox/wp-includes/js/jquery/jquery.js?ver=1.7.1'></script>
<script type='text/javascript' src='http://thatonegeek.com/sandbox/wp-content/themes/Starkers/js/modernizr.foundation.js?ver=1'></script>
<script type='text/javascript' src='http://thatonegeek.com/sandbox/wp-content/themes/Starkers/js/foundation.js?ver=3.3.1'></script>
<script type='text/javascript' src='http://thatonegeek.com/sandbox/wp-content/themes/Starkers/js/app.js?ver=3.3.1'></script>

Add IE Only situation
every person loves to proceed that extra mile to make things work in Internet Explorer right? To make sure your base structure resides responsive in Internet Explorer, you need to add a few dependent declarations. These should go in your header.php document before the closing head tag.

<!--[if lt IE 9]>
<link rel="stylesheet" href="/css/ie.css">
<![endif]-->

<!--IE Fix for HTML5 Tags-->
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->>

Working With the structure
Now that your topic has Foundation setup, to make use of all its responsive characteristics you need to conceive utilizing the base grid scheme. Like other responsive frameworks, it’s a scheme made up of 12 columns. Other encompassed features are pre-set button methods, tabs, benches and much more. Ascertain out the Foundation documentation to view all bells and whistles and directions on how to work with the grid.

Going With a Pre-Packaged topic
there is abounding of free and premium WordPress themes available that make use of responsive design. If you would rather start with something out of the carton, you can try out these topics:

WordPress Bootstrap, by 320Press
WordPress Bootstrap is a topic evolved on Twitter’s Bootstrap v.2.0.1. It’s completely responsive with four distinct sheet templates to select from, shortcodes, and multiple sidebar choices. Once established, you can check out bootswatch.com to download distinct hue versions of the topic.

iTheme2
Based on the Themify structure, iTheme2 uses newspapers queries to target different displays, comes with a customizable characteristic slider, a social newspapers widget, two different topic coverings and you can have up to four footer widgets.

Responsive Twenty Ten
The Responsive Twenty Ten topic carries flexible images, margins, and wireless images. It was conceived as a progeny theme for the encompassed Twenty Ten theme.
Good negligible (Premium)

Good negligible is a clean, minimalist responsive layout that adapts to a multitude of exhibitions and apparatus. Good negligible arrives with two different methods, carries unlimited custom sidebars, shortcodes, multiple fall down menus, and several other features.

Modulo (Premium)
modulo is a responsive, fluid layout, supporting google fonts, shortcodes, multiple sliders, portfolio sheet templates and hue customization. Modulo also comes with 5 made-to-order widgets, encompassing one for latest posts with thumbnail support.

Conclusion
Responsive conceive is continuing to augment in attractiveness and understanding how to utilize it inside your future topic construction will be crucial for success. Whether you are supplementing a framework to your topic or utilizing a pre-built topic supporting responsive design, your clients are going to expect multiple device support as a rudimentary service.

Are themes you conceive responsive? Do you use a responsive framework we haven’t cited? Notify us all about it in the remarks below!

0 comments:

Post a Comment