Index.php, The Loop and your WordPress Content

We have already discussed the header and the menu in our previous articles. In continuation of our series, we will now take a look at the Content section of the WordPress theme or the index.php. Here’s a recap of what we wrote:

Content Column (index.php)

The content container in WordPress plays the most important role. It holds the WordPress Loop which dictates the generation of content on the page depending upon the request by the user.

Content, on the other hand, consists of text, images, or other information shared in posts. This is separate from the structural design of a web site, which provides a framework into which the content is inserted, and the presentation of a site, which involves graphic design.

Now, let’s take a look at what a Loop is. According to the WordPress Codex:

The Loop” is the main process of WordPress. You use The Loop in your template files to show posts to visitors. You could make templates without The Loop, but you could only display data from one post. The Loop should be placed in index.php and in any other Templates used to display post information.

The Loop is PHP code used by WordPress to display posts. Using The Loop, WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags. Any HTML or PHP code in the Loop will be processed on each post.

Before The Loop goes into action, WordPress verifies that all the files it needs are present. Then it collects the default settings, as defined by the blog administrator, from the database. This includes the number of posts to display per page, whether commenting is enabled, and more. Once these defaults are established, WordPress checks to see what the user asked for. This information is used to determine which posts to fetch from the database.

If the user didn’t ask for a specific post, category, page, or date, WordPress uses the previously collected default values to determine which posts to prepare for the user.

After all this is done, WordPress connects to the database, retrieves the specified information, and stores the results in a variable. The Loop uses this variable’s value for display in your templates.

Below is a visual of how all these php files and templates work together. It shows which template files are called to generate a WordPress page based on the WordPress Template hierarchy.

And here’s a sample code of a simple index page:

<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>

For beginners out there, it’s like telling WordPress to do certain functions based on a set of defined parameters – an “if”-“then” scenario. “IF” (parameter A) is true, “THEN” (execute this action). “IF” (parameter A) is false, “THEN” (execute this action instead).

For the more advanced and those who would like to sink their teeth into something more “meaty”, here are some excellent references and tutorials you can check out:


Fusion Theme from Elegant Themes is HERE!

Elegant Themes’ recently released Fusion Premium WordPress Theme is a theme designed to bring pizzazz into business websites by fusing fun and professionalism together in one awesome theme. Who says business themes have to boring and sterile when you can jazz it up and make it more interesting? This theme is intended for startups, tech companies, and design firms but it can easily be tweaked and adapted to whatever website you have in mind.

What’s hot? Fusion’s generous homepage slider dominates the theme’s layout even beyond the fold giving you maximum room to showcase your very best products or services with a bang. You have a choice of 5 gorgeous backgrounds to wow your audience with and the animated slideshow is smooth and sleek. The font choices used add that overall subtle elegance to the whole theme while still maintaining readability.

This premium WordPress theme also includes several page templates like: a contact form with built in Captcha, a portfolio section with 5 layout options, a sitemap, an image gallery, an advanced search page, and a not your usual WordPress login page. You can also assign content like quotes, article excerpts, client logos or icons to specific widgetized sections for that professional feel.

Overall, Fusion’s theme layout, color styling, font choices, and built-in features and functionalities are great as is but if you want to customize certain features to make it more custom you can do so via its powerful Theme Options Panel. You can also enhance other functionalities with the use of the theme’s shortcodes. This premium WordPress theme is responsive so you can be assured that you the same pizazz is there no matter what screen size you view it in.

Features:

  • Perpetual Updates
  • Secure and Valid Code
  • Browser Compatibility
  • Complete Localization
  • Unlimited Colors
  • Unparalleled Support

Fusion Premium WordPress Theme includes top-notch tech support provided by Elegant themes’ support staff to help you setup your site and get it running in no time.

Get Fusion from Elegant Themes Now!

25 Basic Adobe Lightroom Tutorials for Learners

The phrase “photo editing” has become synonymous with “Adobe Photoshop”. Photoshop is the industry leader when it comes to editing images. But one drawback of Photoshop is that a designer needs a good amount of coaching before he can use Photoshop properly. A coaching center near my house promises to teach Photoshop in 2 months to the layman. Not everybody will be willing to invest two months to learn a photo editing software, especially when one does not intend to choose photo designing as a career.

Understanding this problem, Adobe has designed another software named Adobe Lightroom to help even the general public to easily edit images. To quote Adobe’s website – “Lightroom includes all the tools you need for most digital photography tasks in one intuitive solution. Lightroom helps photographers work faster and more efficiently with one image, a set of images, or a large image library.”

When I stated that Lightroom can be used for the general public I don’t mean that one can begin using it merely after installing it. Obviously you need to have some guidance to use the software properly. Therefore, in this blog post, I have collected a list of 25 excellent tutorials on how to use Lightroom properly and get desired results.

(more…)


Coming Soon: Origin Theme by Elegant Themes

Nick Roach has done it again! Origin Premium WordPress Theme is the latest WordPress theme released by Elegant Themes and it is indeed stunning. This grid-based theme is quite impressive both visually and function-wise. You can tell that every design element has been carefully thought of and meticulously designed details have been scattered all throughout the theme if you care to spot them.

Origin is a gorgeous portfolio-styled theme but it is also engaging and fun to navigate around. It’s like going on a treasure hunt where you expect to find some hidden treasure as you explore every item on every page. The overall experience is one of delight and surprise. Customization is quick and easy. This theme comes with 5 deliciously combined preset color schemes that immediately engage your eye. These pre made color schemes are good to go right out of the box but you can also create your own color palette based on your own branding preferences.

This premium WordPress theme comes with several built in page templates like an image gallery page, an advanced search page, a portfolio page with several display options, a blog feed page, a contact page, a secure member login page, and a sitemap for those concerned about content showing up in bot crawls and searches. There are also tons of shortcodes giving you more customization and functionality options.

Origin Premium WordPress Theme uses CSS media queries and AJAX infinite scrolling features to ensure that your website will display and function beautifully and intuitively no matter the screen size and device. If you are considering an upgrade to your own site or doing a project for a client, Origin has infinite possibilities and potential for turning your site from good to great.

More Features:

  • Responsive design
  • ePanel Theme Options
  • Large collection of shortcodes
  • Premade Page Templates
  • Perpetual Updates
  • Secure and Valid Code
  • Browser Compatibility
  • Complete Localization
  • Five Unique Colors
  • Unparalleled Support

Origin Premium WordPress Theme includes top-notch tech support provided by Elegant themes’ support staff to help you setup your site and get it running in no time.

Preview the Origin Theme

Useful Resourcse to Help You Understand WordPress Theme Structure

Trying to understand how WordPress works can be overwhelming with the tons of resources available online. Below is a compilation of some great resources we’ve narrowed down to help you get your feet wet as you start practicing your WordPress coding skills: