1. WordPress

Seven years ago, when I started with WordPress, I thought of it less as a tool and more as a requirement. My client needed a content management system (CMS) and I had grown tired of some of the other popular choices available at that time. Today I encourage my students and colleagues to learn WordPress, and you’ll need to learn it if you want to work with me. That shift in thinking didn’t take seven years; in fact, I fell hard for WordPress shortly after starting with it.

I hope that after you get through this entire book, you’ll see what I see in this powerful CMS. If you’re going to be a WordPress developer, or even a user, it’s important to have a good foundation in its history, terminology, and usage. We’re about to cover a lot of that in this chapter.

What you’re about to learn

• The history of WordPress

• When to use WordPress

• A high-level overview of the design and development process

More than Blogging

Today there are hundreds of millions of websites delivering content to billions of visitors. We see social networks, content delivery sites like YouTube, blogs, business sites, personal sites, and even websites about your neighbor’s cat Fluffy. Typical visitors don’t realize the amount of work or the number of moving parts required for a website to run. As a web designer or developer, you have a better idea of what tools exist to help you power websites, and you’re obviously aware that WordPress is one of them (you’re reading this book!). You probably also know that WordPress isn’t just a blogging CMS anymore. In fact, WordPress has emerged as one of the most powerful CMSs in the game.


Note

In 2012, 22 percent of all new domains (websites) will be powered by WordPress.


Let’s take a quick look at the history of WordPress so you have a context for the practical details you’ll be learning in later chapters and are better equipped to talk the talk (Figure 1.1).

Image

Figure 1.1. In the WordPress logo, WordPress is spelled with a capital W and P. This is the proper way to write WordPress.

History

If WordPress had a birthday, it would be May 25, 2003. Matt Mullenweg announced WordPress version 0.7 was available for download that day and, in my opinion, it should be a day remembered in history, or at least the history of the Internet. Later, Mullenweg formed Automattic, which is now the company behind WordPress.com and several free and premium WordPress plugins.

Currently, the WordPress Foundation manages WordPress and its projects. It’s important to note that WordPress is distributed under the GNU General Public License. I encourage you to read more about the license here: http://wdgwp.com/license.


Note

“The WordPress Foundation is a charitable organization founded by Matt Mullenweg to further the mission of the WordPress open source project: to democratize publishing through Open Source, GPL software.” http://wordpressfoundation.org


WordPress.com and WordPress.org

If you’re at a WordCamp or a WordPress Meetup and ask a generic question, a veteran developer might ask you to clarify whether you’re referring to WordPress.com or WordPress.org. It’s a simple way to understand whether you’re referring to the free website hosting service, WordPress.com, or the software we download, develop, and launch ourselves, housed at WordPress.org.

Essentially, the software is the same. WordPress.com runs the same WordPress we know and love, it’s just on a shared network. Remember the days of Angelfire and GeoCities, where you could sign up and build a free website? WordPress.com is like that. You can sign up, and launch your own WordPress-powered website for free. You can even point over your own domain and choose from premium themes. However, you can’t write your own functions, build on functionality, or activate any old plugin. Since WordPress.com is on a shared network it limits what people can do, because one mistake could impair the entire network. As web designers we want more freedom, so this book will focus on WordPress.org.

WordPress.org has WordPress software available to download, as well as plugins and themes to activate and resources to educate yourself about the system. There are also forums, ways to stay on top of development, opportunities to contribute your own code to the core, and more. The software downloaded from WordPress.org requires you to have a server or hosting account and other essentials, which we’ll cover shortly.

WordPress Resources

Chapter 20, “WordPress Community,” goes into detail about the WordPress community, available resources, events, and ways to continue your WordPress education. In addition, reference websites and free resources are mentioned throughout this book. Below is a quick list of those sites and a little bit about them.

The WordPress Codex (http://wdgwp.com/codex) is a huge library of WordPress functions, calls, hooks, filters, and more. It’s basically a WordPress manual written by the WordPress core development team and outside developers like us. There are educational documents, tutorials, and a “living repository” for general WordPress information.

WordPress Forums (http://wdgwp.com/support) are available to users and developers of all levels. It’s wise to understand the different forums and when and how to publish to them. The forums are a great place to go when you can’t find what you’re looking for in the codex and you need help solving a problem.

WordPress Extend (http://wdgwp.com/extend) is where you go to build on inherent WordPress functionality. You can share ideas, report bugs, and learn more about how to publish from a mobile device. The biggest reason to visit the site is to download any of the approximately 20,000 plugins or 1,500 themes available for free.

Is WordPress the Right Choice for Your Project?

Well, I hope it is, because I don’t want you returning this book! The truth is that WordPress is a powerful CMS that offers many tools, an easy-to-understand and robust application programming interface (API), and a large community of designers and developers contributing to make it better. WordPress has come a long way in the last few years, emerging as a full-blown CMS in late 2009 with version 2.9. However, to formally evaluate this question, we should make clear what WordPress is and what it’s not.

What WordPress Is

WordPress is a CMS, which, by definition, helps you (or your client) manage and publish content with little knowledge of web markup or code. Whether you’re a seasoned developer or a small business owner just looking to update his website, a CMS can help you by alleviating mundane tasks and barriers to publishing content.

WordPress is open source, meaning it’s free and available to the public. While there are costs involved in hosting and supporting WordPress, the actual software is free and available to everyone. Open source also refers to the fact that the code, graphics, and other files that make up WordPress are readily accessible to anyone who wants to work on the CMS, improve it, or just mess around and learn from it.

WordPress is the most popular CMS used today. There are hundreds of CMSs on the market. Many are free and some are open source, but others are neither. WordPress has cornered the market, offering a free service to anyone who wants a website. Today there are approximately 72 million WordPress-powered websites on the Internet. No other CMS comes close to these numbers.

WordPress is fast, reliable, and scalable. If you’re planning a website for hundreds of thousands of unique visitors a day, please don’t simply dismiss WordPress. There are some really large websites with huge traffic numbers that are built for speed and growth. It may surprise you to learn that NBC Sports, CNN, Time, UPS, TechCrunch, CBS, and Mashable have websites powered by WordPress. Combined, these sites get millions of hits daily. Head over to http://wdgwp.com/vip and see other well-known sites and companies, if you’re not convinced.

What WordPress Is Not

The following examples aren’t intended to discourage you from using WordPress for these types of projects. Just know what you’re getting into and understand what other solutions exist on the market before diving into using WordPress for these kinds of sites.

WordPress is not an e-commerce platform. Managing thousands or even hundreds of products is still difficult, not to mention tracking orders, conversion, inventory, and more. That said, many e-commerce websites are powered by WordPress. There are several viable plugins that build on WordPress functionality that can turn your site into a full-fledged e-commerce website.

If you have a WordPress website already built and you want to sell a couple dozen items, then plugins like WooCommerce (http://wdgwp.com/woocommerce) or WP e-Commerce (http://wdgwp.com/wp-ecommerce) can help you accomplish your goals.

WordPress is not a web directory framework. Managing huge directories in WordPress, like products in a store, is difficult. The user interface just isn’t made for it. Of course, there are exceptions to the rule. In fact, one of my first WordPress out-of-the-box projects was building a 23,000-page directory that had to allow for searching, filtering, taxonomy, and more.

My Recommendation

With the advancements made in the API in the past few years, the number of plugins and themes, and the learning resources available, it’s safe to say that WordPress should be on everyone’s list. Is it the absolute right solution for you? That’s hard to say, and frankly I’m biased. I have dedicated my career to WordPress, and because of the sheer amount of WordPress work available I have not had to build many sites using competing CMSs.

I could go on and on about the advantages of WordPress, but at the end of the day it’s up to you to decide if it’s right for your project. Knowing how to develop WordPress websites is an exceptional skill to master. With the number of WordPress-powered websites growing, there will be more and more WordPress projects and jobs out there.

Requirements

If you’ve come this far, you’ve probably decided that WordPress is the right tool for your project. Now it’s time to discuss what WordPress actually needs to function. WordPress is built with PHP, a server-side programming language. PHP is also open source and there are countless websites, books, and resources dedicated to educating you on PHP programming.


Note

I can hear the alarms going off in your head. You’re thinking, “I don’t know PHP and it seems really hard!” Don’t worry! I’ve taught WordPress development to countless students who had nothing more than HTML and CSS experience. In most cases you can build a WordPress theme without even realizing that you’re writing PHP.


WordPress Hosting Requirements

Here’s a list of the hosting requirements: PHP version 5.2.4 or greater, and MySQL version 5.0 or greater.

Yes, that’s it! WordPress basically needs a database and PHP to run. Most servers and hosting companies offer these basic services, often at very low cost. It’s common to get a Linux server running Apache (the server software installed on most “boxes”), PHP, and MySQL for under $10 a month. You can read more about WordPress Hosting Requirements here: http://wdgwp.com/requirements.

Hosting Recommendations

I’ve worked with many hosting companies over the last 12 years and I keep coming back to one that’s reliable and affordable, and that offers great support. Bluehost offers the hosting of “unlimited” sites for as little as $7 a month. Bluehost is great because it’s super easy to use, offers automatic WordPress installation, and has 24/7 tech support that actually answers the phone. You can sign up for Bluehost at http://wdgwp.com/bluehost.

There are many more hosting companies out there and WordPress even makes formal recommendations, which you can read more about at http://wdgwp.com/hosting.

Site Planning and the Development Process

When you’re developing a WordPress-powered website, the most important aspect to consider at the beginning is whether you’re developing the site for one or many user admins.


Note

I’ll refer to user admins several times throughout this book. A typical static website will have a “user,” that is, a visitor. However, anytime you’re building a website that’s powered by a CMS, you have to consider the user admin. This is the person who controls the CMS after the site has been developed. A user admin can be the web developer, the client, or someone who simply installed your theme. You can’t know what a user admin will do with your product, but it’s important to try and compensate for most of it, if possible.


If you’re building a WordPress site for a single client, you’ll likely have specific direction and details on exactly how the site should function. This means that you can plan and build your theme for exactly what is needed, eliminating a lot of extras and unknowns.

Developing a theme that you make available for public use greatly changes the scope of the project. You’ll know far less and assume a great deal more. You have to make a conscious effort to plan for how a user admin might want to use your theme without bloating the functionality by attempting to compensate for everything.

Planning, Wireframing, and Designing

Since there are literally thousands of developers currently working on or with WordPress, there are many different processes to actually coding a theme. As with any website, I start with content planning and site architecture. With WordPress-powered sites, you want to spend extra time on this phase so you can correctly plan the use of content types, taxonomy, and more (all of which will be explained later in greater detail).

Once I have a good understanding of the site structure, I’ll move to wireframing, then later to the design.

It’s safe to assume that most small websites are developed from designs for a home page and single interior page. Since WordPress uses a series of template pages to display content to visitors, it’s important to know what templates are available and how the content will be generated so you can properly plan for everything. For example, if you didn’t realize that all WordPress websites allow for searching of content, would you design and plan for a search results page? Probably not.

At this point, I’ll ask the designer to give me a set of design requirements for the browser. This way I can plan for all the available WordPress template pages without requiring extra work from the designer. If you don’t design in the browser, then it’ll be important to design your template pages in advance so your site isn’t left broken or poorly planned.

Front-End Development

The next phase is development of the page templates in HTML, CSS, and JavaScript. I’ll slice a design and develop the site in my browser. Before I move to actually developing a theme I’ll code the site completely with static content. The goal here is to make everything work in all browsers set in your requirements and ensure progressive enhancement, site functionality, and everything else before we move to theming.

I sometimes hear the argument that this process creates more work for the developer. I tend to disagree. When you gain enough WordPress development experience, planning for replacing static HTML with WordPress calls will become second nature. I know that I can plan for a site navigation using a <nav> -> <ul> -> <li> structure and simply replace that later with a WordPress call.

Once I replace the static HTML with dynamic WordPress calls, I’ll have to do a little work to carry over HTML classes and IDs while ensuring that the HTML structure is the same. However, once I do, the HTML output will be identical to what I had before, which means the CSS will style the site exactly the same, essentially creating the exact same site.

I’ve been building WordPress–powered sites for many years and I’ve spent a lot of time on the process I’m about to walk you through. I’m open to new ideas, so if you see opportunities for improvement, I encourage you to get in touch with me.

What’s Next

We just covered everything from the history of WordPress to hosting requirements to a high-level overview of the theme development process. In Chapter 2, “WordPress 101,” you’ll learn to install WordPress on your local machine and server, then get a down-and-dirty overview of the admin, adding content, and managing a site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.219.80