Menu Search
Jump to the content X X
SmashingConf London Avatar

We use ad-blockers as well, you know. We gotta keep those servers running though. Did you know that we publish useful books and run friendly conferences — crafted for pros like yourself? E.g. our upcoming SmashingConf London, dedicated to all things web performance.

Posts Tagged ‘Techniques (WP)’.

We are pleased to present below all posts tagged with ‘Techniques (WP)’.

Writing Unit Tests For WordPress Plugins

When my WordPress plugin had only three users, it didn’t matter much if I broke it. By the time I reached 100,000 downloads, every new update made my palms sweat.

My first goal for the WordPress Editorial Calendar was to make it do anything useful. I was new to JavaScript and PHP and didn’t really know what I could pull off. In a few days I had a proof of concept. In a few more I had a working version and was asking friends to install it. The calendar worked… sort of.

Read more...

Inside WordPress Actions And Filters

Gone are the days when WordPress developers, wanting to extend the functionality, had to alter and hack the WordPress core source code directly, resulting in headaches when upgrading and sharing modifications. When WordPress 1.2 rolled out back in 2004 a new plugin architecture was introduced; an architecture that is now commonly referred to as Actions and Filters, Hooks and the WordPress Plugin API.

WordPress Actions & Filters

The WordPress core has been carefully "sprinkled" with actions and filters that external code (in the form of themes and plugins) can hook into, injecting new functionality into the standard flow. The Plugin API provides a neat interface to work with actions and filters. This article aims to gather insight into the inner-workings, elegancy and all the beauty of the Plugin API, allowing WordPress plugin and theme developers to gain a more profound understanding of what happens behind the scenes, why some things work but others won't, and where to look when they unexpectedly don't.

Read more...

How To Integrate Facebook, Twitter And Google+ In WordPress

Integrating social media services in your website design is vital if you want to make it easy for readers to share your content. While some users are happy with the social media buttons that come built into their design template, the majority of WordPress users install a plugin to automatically embed sharing links on their pages. Many of you will find that a plugin does exactly what you need; others not so much.

The Big Three: Twitter, Facebook, and Google+

Some are poorly coded, and most include services that you just don’t need. And while some great social media plugins are out there, they don’t integrate with every WordPress design. If you aren’t comfortable editing your WordPress templates, a plugin is probably the best solution. If you are comfortable making a few edits to your theme, then consider manually integrating social media so that you have more control over what services appear on your website.

Read more...

A Comprehensive WordPress Checklist To Creating The Perfect Website

There is no doubt that WordPress is the best content management system (CMS) for your website. Sure, countless CMS’ are available, ranging from open-source to paid, and you’ll hear evangelists on all sides swearing that their choice is the best. But Drupal, Joomla or any other CMS doesn’t hold a candle to WordPress for its ease of use, security and reliability.

A Comprehensive Checklist To Creating The Perfect WordPress Website

It’s no wonder that Web developers have built over 50 million websites on its sturdy back, or that so many designers would never dream of using anything else. For the sake of this article, let’s agree that WordPress is the way to go, no looking back. With that established, let’s lay out a 15-step checklist to help you create the perfect WordPress website.

Read more...

10 Tips To Optimize Your WordPress Theme

The beauty of WordPress is in how easy it is to adapt for different tasks. One can extend it with just a couple of lines of code. In this post, we’ll review 10 shortcode snippets that will tweak and optimize your WordPress theme. You can add all of these code snippets to the functions.php file in your WordPress theme.

One thing that can go wrong in WordPress magazine themes is when users include too many words before the more tag. Sure, they could handcraft the excerpt in the dedicated field, but on a website that has hundreds of posts and on which the text above the more tag has always been used as the excerpt, going back to create excerpts for all of those posts by hand would be cumbersome. In this case, we can limit the number of words shown in the excerpt by using the code displayed below.

Read more...

Integrating Amazon S3 With WordPress

Computing is full of buzzwords, “cloud computing” being the latest one. But unlike most trends that fizzle out after the initial surge, cloud computing is here to stay. This article goes over Amazon’s S3 cloud storage service and guides you to implementing a WordPress plugin that backs up your WordPress database to Amazon’s S3 cloud. Note that this is not a tutorial on creating a WordPress plugin from scratch, so some familiarity with plugin development is assumed.

The reason for using Amazon S3 to store important data follows from the “3-2-1” backup rule, coined by Peter Krogh. According to the 3-2-1 rule, you would keep three copies of any critical data: the original data, a backup copy on removable media, and a second backup at an off-site location (in our case, Amazon’s S3 cloud).

Read more...

How To Secure Your WordPress Website

Security has become a foremost concern on the Web in the past few years. Hackers have always been around, but with the increase in computer literacy and the ease of access to virtually any data, the problem has increased exponentially. It is now rare for a new website to not get comment spam within days of its release, even if it is not promoted at all.

securityimage

This increase in naughty behavior, however, has spurred developers to write better code, and framework vendors have implemented many functions to help coders in their battle against the dark side.

Read more...

How To Create Native Admin Tables In WordPress The Right Way

WordPress list tables are a very common element of the WordPress admin interface but creating one of those tables is not really an intuitive thing to do when you haven’t done it before. In this article, we’ll see how to generate some native admin tables the right way.

howtosplash550

In this article, we’ll see how WordPress provides functionality that can be used to generate native admin tables. We’ll look at a typical WordPress table and its different components and show how to implement it the right way.

Read more...

The Developer’s Guide To Conflict-Free JavaScript And CSS In WordPress

Imagine you’re playing the latest hash-tag game on Twitter when you see this friendly tweet: "You might want to check your #WP site. It includes two copies of jQuery. Nothing’s broken, but loading time will be slower."

sm-wp-css-js

You check your source code, and sure enough you see this:

<script src="/wp-includes/js/jquery/jquery.js?ver=1.6.1" type="text/javascript"></script>
<script src="/wp-content/plugins/some-plugin/jquery.js"></script>

What went wrong? The first copy of jQuery is included the WordPress way, while some-plugin includes jQuery as you would on a static HTML page. A number of JavaScript frameworks are included in WordPress by default.

Read more...

How To Create WordPress Meta Boxes

What seems like one of the most complicated bits of functionality in WordPress is adding meta boxes to the post editing screen. This complexity only grows as more and more tutorials are written on the process with weird loops and arrays. Even meta box "frameworks" have been developed. I'll let you in on a little secret though: it's not that complicated.

sm-wp_meta-boxes

Creating custom meta boxes is extremely simple, at least it is once you've created your first one using the tools baked into WordPress' core code. In this tutorial, I'll walk you through everything you need to know about meta boxes.

Read more...

New WordPress Power Tips For Template Developers And Consultants

It has been a big year for WordPress. If there were still some lingering doubts about its potency as a full-fledged content management system, then the full support for custom taxonomies and custom post types in WordPress 3.0 core should have put them to rest. WordPress 3.1 took those leaps one step further, polishing custom taxonomies with multi-taxonomy query support, polishing custom post types with native template support for archives and feeds, and introducing features (like the “admin bar”) that make it easier to quickly edit and add content from the front end.

New WordPress Power Tips For Template Developers And Consultants

In the broader community, we’ve seen incredible plug-in suites such as BuddyPress mature, and even the emergence of independent WordPress-dedicated hosting services, such as page.ly. To celebrate WordPress’s progress, let’s review some new tips that can help template developers and consultants up their game even further.

Read more...

10 Things Every WordPress Plugin Developer Should Know

Plugins are a major part of why WordPress powers millions of blogs and websites around the world. The ability to extend WordPress to meet just about any need is a powerful motivator for choosing WordPress over other alternatives. Having written several plugins myself, I've come to learn many (but certainly not all) of the ins-and-outs of WordPress plugin development, and this article is a culmination of the things I think every WordPress plugin developer should know. Oh, and keep in mind everything you see here is compatible with WordPress 3.0+.

Screenshot

[fblike]

The first thing you should do when developing a WordPress plugin is to enable debugging, and I suggest leaving it on the entire time you're writing plugin code. When things go wrong, WordPress raises warnings and error messages, but if you can’t see them then they might as well have not been raised at all. Enabling debugging also turns on WordPress notices, which is important because that's how you'll know if you're using any deprecated functions.

Read more...

↑ Back to top