Streamline Your Success: Harnessing WordPress for Website Development

1. Introduction

Goal: The goal of this book is to show you the inner workings of WordPress and how to code themes and plugins to work in the way that you want them to. It does not cover using pre-designed themes or using plugins that are poorly coded. It will show you how to design themes and plugins the right way. I will not go into specific details on the way PHP, HTML, or CSS works as there is a vast amount of information on that already. I am focusing on the information that is WordPress specific. The book is designed so that you can read it from start to finish, or it can be used as a reference guide. You will not need to read the first three chapters if you are just looking for information on theme development.

Readership: This book is designed for web developers, as using WordPress enables them to more easily manage and release content. It is a comprehensive guide for those new to WordPress and old experts. It is a mix between teaching the basic working of WordPress and a tutorial that teaches how to build a responsive WordPress theme. Be warned, things are done the right way; we code to WordPress’ coding standards as well as use modern PHP and CSS. We are trying to get you to the level where you will be able to understand the core WordPress code and build off it. You will need to know PHP and have a basic understanding of HTML and CSS. If you are a complete beginner, you might want to learn the basics elsewhere.

2. Getting Started with WordPress

When you have a hosting plan in place, it’s time to install WordPress. Most hosting providers offer a very simple way to do this and the WordPress codex itself also offers a very good guide on this. There is also an abundance of other guides and tutorials available as WordPress is so popular. Many of the guides available will go much further than we need to for a basic website but here’s a very quick run through of a couple of methods for installing WordPress. The codex guide is very simple to follow and will take you through the necessary steps. One other notable method for installation is to download the “WordPress Manager” software from TNG Consulting Inc. This is an application for Windows which allows you to take care of multiple WordPress installs and also control some of the elements of these blogs, such as plugins and the theme, via the software itself. This can be a much simpler and quicker way if you are intending to install multiple instances of WordPress or want more control over each install.

3. Choosing the Right Theme

The following are important factors to consider when choosing a theme: – Novice web developers should choose a theme that has the design and layout that is closest to what they want to achieve. This will make customizing the theme easier. More experienced developers can choose a theme that requires a significant amount of customization if they are aiming for a completely unique design and feel. – Themes should be checked using their URL with a search engine. Some themes do not use clean code and can significantly hinder a website’s search engine ranking. This is detrimental because it will be hard to attract the target audience if the PageRank is low. – Website Accessibility should be tested when using a theme. It is possible for a theme to look great, but have color combinations or layout designs that make the website difficult to read. This can cause a higher bounce rate and lower the amount of repeat visitors. – The support and update information for a theme is located to the right of the page when browsing themes from the WordPress Dashboard. It is important to use a theme that will be supported and updated so that it will not break when WordPress is updated. Themes should also be tested for browser compatibility. Theme previews can look slightly different between different versions of Internet Explorer and other web browsers, so it is important that the theme is thoroughly checked using multiple browsers.

There are thousands of themes available for WordPress. It is important to choose a theme considering the website’s target audience and the niche. For instance, the most intuitive theme for a news site is not a good match for a medical website.

4. Customizing Your Website

Assuming you have a theme that you are happy with (or if you’re just interested in modifying things like page content), WordPress includes a set of tools that enable site customization without actually modifying the theme files. These are found in the WordPress admin panel, underneath the Appearance tab. Here you’ll be able to edit the theme’s CSS, tweak the color scheme, and do things like set a static front page. These kind of features are great for people who want to avoid the complications of editing theme files. The downside is that it’s not entirely possible to make complex changes like adding new widgets or widget areas. If that’s the case, these tools may serve as more of a basic starting point from which to jump into the actual theme files.

If using other themes, or if you are interested in digging into the code, then it’s always a good idea to first create a child theme. A child theme is a theme that inherits the functionality and styling of another theme, called the parent theme, and allows for the modification of the parent theme. Why would you want to do this? The benefit is that when the parent theme is updated, your modifications are not lost. I have had to deal with updating sites with a modified default WordPress theme, and it’s not pretty. You need to compare every single file and directory, and any new features/additions to the default theme will be missed or messed up. A child theme neatly bypasses this problem. It is somewhat of a complicated feature however, so it’s up to you to decide whether it’s worth doing.

One of the most powerful features of WordPress is its flexibility and the ease with which one can customize a website. As mentioned earlier, the Thesis Theme allows for rapid site development, without the need to touch code. It includes a comprehensive design section that allows for quick and easy site and content layout customization. The design section includes an automated CSS compression tool, which can be very helpful for making your site faster. As well, the Thesis OpenHook plugin has recently been released in beta form. This enables web developers to make very precise customizations without having to dig into the code.

5. Optimizing for Search Engines

A recent and useful SEO plugin for WordPress is Scribe. Scribe helps to optimize content as you write it by suggesting changes to match keywords and by showing you SEO data related to your content. This sort of SEO guidance is particularly useful for those who are new to search engine optimization, but it still has great benefits for the experienced user.

One of the major advantages of using WordPress for SEO purposes is the ability to make use of a variety of plugins. A plugin is a small application, or combination of applications, which add a specific set of features to a WordPress site. The All-in-One SEO Pack is extremely useful, and best of all, it is free. This plugin works to optimize your titles for search engines and can generate meta tags automatically. When using WordPress, duplicate content can be a particular issue because of the way posts are archived and categorized. The AIOSP will inform search engine spiders not to index these pages, helping to avoid duplicate content penalties.

WordPress can significantly aid in the process of optimizing for search engine rankings. There are a variety of tactics that can be utilized to ensure that your website will be well indexed by search engines, increasing your visibility to users who are searching for your product or service.

6. Enhancing User Experience

There are many ways you can improve user experience on your website. Your website design should be top notch with easy navigation tools. Images should be optimized for fast page-load times and broken links should be regularly checked for and fixed. Any of these factors mentioned will quickly deter users from returning to your site. Adding new content frequently will also give users something to look back into your site for and improving any of the factors mentioned will promote users to recommend your site to others. Always bear in mind that the difference between good and bad user experience can be a few simple factors but they can have a huge impact. Due to the fact that people perceive things differently it can be as well to get a second opinion on your site. An opinion from another developer may improve usability of the site. Often it can be easy to miss small factors which could quickly be fixed. We offer website reviews and have a team of professional developers who can look into your site and give you feedback about how to improve user experience and gain more traffic.

7. Adding Functionality with Plugins

This works to keep all WordPress content, whether it be managed through the admin console or on the front-end, in the context of the WordPress engine. This is extremely useful for those who have syndicated their website to appear on a blog network, as they can keep the standard blog on their site but utilize all the admin console features to post to a different database. The only way to access content is through the admin console, so building custom admin features is indispensable for content managers.

The plugins directory is an integral part to understand if you want to add custom syndicated content on the WordPress front-end. Simply put, a WordPress plugin is a PHP file with a standard header. The header contains information about the plugin, such as its name and author. When you activate a plugin, the WordPress admin console loads this header information into its plugin management area. This information tells WordPress where to access the file when it needs to execute the plugin. Executed plugins remain in the plugins directory and cannot manipulate content outside of it.

Each time you add a new bit of functionality to a site with hand-coded PHP, you elevate the barrier to entry for clients and content managers who may want to take over the site in the future. A WordPress Plugin is intended to extend or add to the functionality of WordPress. As a feature, I have used it to add custom features to the WordPress administration, in posts, and on the front-end. The execution is easy: you upload the zip in your admin console under Plugins – Add New. Alternatively, you can download the package and extract the files to your plugins directory. This is much quicker than coding new functionality directly into a theme because it is written with administrators in mind and allows one to activate or deactivate the plugin via a simple check box.

8. Securing Your WordPress Website

When a WordPress update is released, it’s usually mentioned in the admin panel when you first login. Almost every new release contains possible security holes that are fixed from the prior version. It’s very easy for a malicious individual to see “WordPress 2.3 is out, I wonder what vulnerabilities were fixed from 2.2.3. I’m going to go look them up and see if I can exploit them on some blogs”. WordPress is very popular, and unfortunately hacking attempts are common. This is another reason why it’s very important to keep your WordPress install updated. Always check for the latest release every couple of weeks. Be sure to have a backup of your WordPress files before updating in case anything goes wrong. I have never had an update go wrong, but you never know what could happen. After updating, be sure to check your WordPress driven pages to be sure everything is functioning well. In very rare cases, an update might cause compatibility problems with a plugin or theme due to a deprecated function used in the prior release. But again, this is extremely rare.

When first installing WordPress, I highly recommend that you choose a very unique username and password for your admin account. Do not use the default “admin” username. If a hacker wanted to break into 1000 WordPress blogs, a good portion of them will have the default “admin” account, so you’re already giving yourself a big advantage with a unique username. As for your password, make sure it is complex, containing a mix of numbers, letters, and even punctuation/capital letters if possible. An example of a strong password would be “5Kgjd$#5fdjphl43g540392l20”. It’s not hard to remember if you type it out a few times, and very hard for a hacking program to figure out.

When I first started using PHP/MySQL based websites like WordPress, they were frequently hacked because of my ignorance to correct security measures. I want to note that WordPress itself, or any script for that matter, is rarely hacked because of coding vulnerabilities. I want to emphasize that, your websites are usually hacked due to poor security on your part such as weak passwords, an outdated WordPress install, an insecure web host, and other common mistakes.

Out of all the chapters in this book, I am most excited about sharing my knowledge here. This chapter will save you headaches, confusion, and at worst, complete loss of your website due to hackers. By using the techniques I will show you, and applying a bit of updated knowledge, you can almost guarantee you will be safe against attacks.

9. Managing Content Effectively

In WordPress, there are a number of options available to you for managing your content. We have published an overview of the WordPress post and page system that will illustrate the basic ideas behind effectively managing your new content. The first thing to understand is that posts and pages are essentially the same thing. It will be helpful for you if you think of these two terms as different types of content. When we consider content such as articles or essays, putting it into a post is the desired method. Content like “About Us” or “Contact Us” would be better suited to a page. The distinction is mainly due to the ways in which these two content types are typically displayed. Posts are dynamic; they are displayed in reverse chronological order on your blog’s front page. An individual post can also be displayed on a category page or a tag page. This is the default behavior of a post, and you can further customize where and how posts are displayed using a custom post template. Pages are static and can be displayed outside of the regular blog chronology. Typically, pages do not have a date associated with them and are not included in search results.

When you develop a website, you set off hoping it will make a difference to your business or group. Often, the difference is affected by the effectiveness of the information represented on the website. If this is true, then the method used to insert this information is crucial. The WordPress blogging platform is a powerful tool in web development. It allows users to insert an incredibly dynamic range of content with relative ease. This results in less time creating the content and more time managing and presenting the content. The free plugin directory alone has shown to be of value to WordPress users to the tune of more than a few million site hits.

10. Integrating Social Media

The next step is to begin posting your content to your social media platforms, even if you are just starting out. The more content you can get out, the better. This will give your few viewers something to look at if they decide to follow you on social media, and will create a portfolio of posts to which you can refer new site viewers in the future. The most effective content is often content that is useful in some way, but as your site grows and you accumulate more posts, you can begin to recycle old content with the intention of bringing more traffic to past articles. This creates a system where there are multiple ways to access any given post on your site, as well as many different entry points for new viewers.

The goal for your social media efforts should be to create content that is easily shareable on multiple platforms. This creates the potential for exponential growth. The first step in doing this is adding clickable links, badges, or widgets to your site that lead viewers to your various social media profiles. It is helpful to do this right away when you’re creating your website, and then go back and add more later. This way, if someone likes your site and wants to follow you on Twitter, they can immediately do so, and you won’t be losing their interest by telling them to “check back later” to see if you’ve added the link.

11. Monetizing Your Website

Ads are a quick way to get revenue, but they won’t be much unless you have a high traffic rate. Cost-per-click (CPC) ads can be placed on your site easily and are only a successful way to earn revenue. Google AdSense is a popular program that has ads for both CPC and CPM, and their program is easy to install. Keep in mind you want to choose ads that are relevant to your content for a higher chance of revenue. High-paying ads are often not in relation to blog content. This can be filtered, but it is often difficult to acquire specific high CPC or CPM ads. Google AdSense will automatically choose the most relevant ads for your site, and you may need to do some work through other sites to filter. With AdSense, you can be paid as soon as you reach $100 and can choose to get checks more regularly as you’re earning.

The first thing to consider is what type of advertisements you’re intending to run. You can either run CPC (Cost-Per-Click) ads or CPM (Cost Per 1000 Impressions) ads. CPC ads are usually banners that you place in your content or sidebar. Every time a reader clicks the ad, you are paid for that click. With CPM ads, you are paid a set amount based on how many page views the ad gets. Often times, you can sign up for a network that will choose ads based on your content. However, bloggers who aren’t getting a significant amount of daily traffic won’t see much revenue from CPM ads.

Monetizing your blog can be a long and confusing process, but the journey is rewarding for bloggers who plan to turn their blogs into a full-time job. If you plan on monetizing your blog, it is important to consider how each method fits into your current blogging style and long-term goals.

12. Testing and Debugging

If you need to take debugging to the next level, take a look at the Monster Widget, written by Otto. This widget is a debugging tool included in every copy of WordPress. It provides an instance of every core widget that is bundled with WordPress and provides an easy approach to developing and debugging widgets of your own. But the best thing about this tool is the uninstall method. During testing, you are quite likely to throw away old and broken bits of code, and leftover options in the wp_options table are unnecessary. Monster Widget has simply solved this problem by having an uninstall feature when the plugin is deactivated.

WordPress now has a built-in WordPress Coding Standards, which is a PHP CodeSniffer ruleset. Any code that does not conform to the WordPress coding standards can be quickly identified and cleaned up. This is a powerful tool when developing themes or plugins and really helps to keep your project’s codebase maintainable. Plugin and theme developers should also note that using WP_DEBUG is a constant that can be defined in your wp-config.php file to enable the debug mode throughout WordPress. This should be used during development and testing of your plugins and themes to help surface any PHP notices and warnings.

For those working with HTML and styles, make sure that your markup and CSS are validated and up-to-scratch. Debugging someone else’s code can be hard enough without worrying about simple problems in the fundamentals of your project. W3C validators simply compare your code to a set of standards and tell you if and where you have gone wrong. Compliance with these web standards will ensure that your documents are more accessible, more maintainable, and more search-engine friendly.

Don’t assume that the rest of the world is using the text editor, screen resolution, operating system, or browser type that you are using. Get your plugin and/or theme into the hands of as many people as possible and find out where it breaks. While having the latest and greatest technology is always nice, remember to test your work in as many environments as possible. Too often have we seen developers and designers create something incredible, only to have it broken in the less-than-spectacular browsers such as Internet Explorer.

13. Performance Optimization

Many people imagine caching as the best way to improve performance. It’s actually the best way to improve performance without improving performance. What this means is that improving the performance of the underlying problem is always more effective than simply masking it with a caching mechanism. Caching a page stores the end result of a process, but there is usually a series of actions that lead to that result. Let’s take, for example, the generation of a document by a user. At the end of the process, the document exists, but if the document was deleted or lost part way through, the user would have to generate it again. Improving the performance of the document generation saves resources compared to simply storing the end result. That said, there are some extremely innovative caching solutions being developed, and many of them are very effective. If you do not have the expertise to improve performance in a particular area, caching can still be a very valid option. In general, however, the more intricate and specific a caching solution, the more it should be relying on cached data that you know is already both correct and optimal. Adding a cache to a slow function will make the slow function seem faster, but it is still slow. Step one is to always improve the performance of the function itself. Cache for emergencies.

Database queries are often pointed to as a source of slowness. This is true, but it’s the case in the same way that electricity is often pointed to as the source of power in your computer. The real question, and often the real problem, lies with how you are using it. A plugin might be coded in a way that is asking for data in a suboptimal way. You might be displaying data in a way that is less than optimal. Either way, the solution isn’t necessarily to add a caching layer, but rather to find out why the queries are slow, and then optimize them. If you are not experienced in this area, focus on the specific queries that the slow loading page is using. Often this requires knowledge of the specific plugin or theme being used to display the data.

Compatibility with PHP and MySQL versions, web server, and indeed web browser used, plugins activated, all have a profound effect. And if any aspect of your server is underpowered, you’ll need to address it with your hosts.

14. Mobile Responsiveness

This does three things: 1. It hides all blog titles and taglines (they look funny at the top of posts). 2. It simplifies the header, making only the nav and search bar visible. 3. It stacks main and sidebar on top of each other and maximizes their width, and it adjusts the body of each individual post to be full screen width.

To adjust the site to be mobile-responsive without changing the rest of its layout, use:

@media only screen and (max-width: 600px) { .site-title { display: none; } .site-description { display: none; } #header { text-align: center; margin: auto; } #main { clear: both; } .widget-area { display: none; } .syndication-link { display: none; } #primary, #secondary { width: 100%; float: none; padding: 0; } .content { margin: 0; } .image-attachment img { width: auto; max-width: 100%; } }

15. Website Maintenance

The two most immediate examples where non-maintenance of a website can lead to problems are when using software with it, such as WordPress and Joomla, and content updating. With software, WordPress, for example, often has updates to either the core mechanics or the database, to help combat security threats and improve functionality. If your version of WordPress is outdated and you have made heavy modifications to the code or the database, you may find after updating that certain parts of your website no longer work as intended. Failure to maintain your website will have you accumulate Joomla or WordPress updates, software, plugin/add-on, and security updates, and then incompatibility issues. As for content updating, if you rarely change your website save for adding blog entries, the face of the internet is ever-changing, and the longer you leave it without updating, you may find certain PHP/HTML code is no longer valid or works unexpectedly due to browser changes and updates.

Certainly one of the most crucial yet often overlooked aspects of developing a new website is the ongoing maintenance of it. While perhaps at first everything may run smoothly with no problems, without proper maintenance, your website could easily become a mess that doesn’t work. Some of the issues that may arise if you do not maintain your website are: broken links, unnecessary bloat to your code (either through your own editing and forgetting, or software and/or plugin installations), increased security risks, and decreased loading times.

16. Conclusion

As a beginner’s guide, this book has accomplished its goal to instruct and train users upon the vast features WordPress has to offer. Readers from this book who absorb the content and implement it to their ongoing or next web project will undoubtedly save time or resources that they would usually waste. They will be introduced to more efficient methods of building web content and a potent content management system that will support them throughout their ongoing web endeavors.

The book “Streamline Your Success: Harnessing WordPress for Website Development” has represented a meticulous resource for developers, more particularly beginning web developers who wish to implement WordPress in their web projects. It explains the well-established WordPress CMS in depth and its support as a powerful web development tool.