WPMU DEV's Blog - Everything WordPressMiscellaneous - WPMU.org http://premium.wpmudev.org/blog The WPMU DEV WordPress blog provides tutorials, tips, resources and reviews to help out any WP user Thu, 23 Oct 2014 12:00:37 +0000 en-US hourly 1 http://wordpress.org/?v=3.9.2 Creating a WordPress Custom Functions Bible – and Snippets to Get You Started http://premium.wpmudev.org/blog/creating-a-wordpress-custom-functions-bible-and-snippets-to-get-you-started/ http://premium.wpmudev.org/blog/creating-a-wordpress-custom-functions-bible-and-snippets-to-get-you-started/#comments Wed, 15 Oct 2014 12:00:00 +0000 http://premium.wpmudev.org/blog/?p=132829 To hazard a guess, I would estimate WordPress developers realize the benefits of storing and reusing code snippets after their third or fourth WordPress site.

It not only ensures your development practices stay consistent from project to project, but also greatly improves your development efficiency.

Time saved from being able to avoid trawling through industry blogs and scouring recent projects functions.php files searching for that gem of a function you knew you once used can dramatically improve a project’s turnaround time.

Suggesting developers should save every snippet of code inside a mammoth “custom-functions-bible.php” file is not only completely ridiculous but also counterintuitive for development efficiency. Something as simple as creating a functions.php boilerplate or taking advantage of Adobe Dreamweaver’s snippets should suffice.

Code repositories are not only great ways to improve individual efficiency, but team efficiency, too. By encouraging your team of developers to take advantage of online resources such as using GitHub to build useful code repositories that are shared and updated within your team will help increase efficiency and learning.

In order to get you started, I have compiled a selection of some of my favorite custom functions for you to begin using throughout your projects.

Functions bible
Create a repository of your custom functions for easy access.

Limiting Words

Like many developers I often find myself needing to limit the length of a dynamic piece of content. Achieving these results by limiting the characters using simple PHP functions like substr() may be easy to implement but look messy for front-end users as the final word will often be chopped in half.

Aiming to limit your content by an amount of words is a much more elegant approach to this issue. Limiting a post by an amount of words can be achieved with the use of the built in WordPress function the_excerpt(); As standard the_excerpt() limits your content to the first 55 words, after which a […] is appended onto the post.

Great as this is, I often need more control over the length of the posts retrieved within a loop. To do this we have two options:

Option One – Controlling Excerpt Length Using Filters

My first recommendation would be to change the default limit of the_excerpt() using filters. The method outlined below simply needs to be added to your themes functions file and globally your posts will be limited to your desired amount.

1
2
3
4
5
function custom_excerpt_length( $length ) {
return 20;
}

add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

Option Two – Controlling Content Length Using A Custom Function

It is easy to run into issues with option one as it is a global solution to limiting the excerpt. Some developers may not be looking to limit the_excerpt() or may have numerous different custom loops which each require different excerpt lengths to be set. Unfortunately, option one isn’t going to solve these common issues.

By creating a custom function to look after this task allows developers more control over exactly what type of content to limit. The following function takes two parameters:

  1. $string – The string that needs be limited for example get_the_excerpt().
  2. $max_words – The maximum amount of words you would like to show.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Limit Your Website Excerpt */

function word_limit($string, $max_words){

$post_words = explode(' ', $string);

$count = count($post_words);

$post_words = implode(' ', array_slice($post_words, 0, $max_words));

if($count > $max_words):

return $post_words . '...';

else:

return $post_words;

endif;

}

A Very Brief Overview Of How The Function Works

The function begins by taking the string and exploding it into an array, once in an array we are able to limit the array using the PHP function array_slice() and implode it back onto our page. If the content has been limited the function appends a “…” to the end of the post.

This function is a perfect example of how to correctly limit a piece of content on your website.

Removing WordPress Version Number

Improving WordPress security should not be overlooked on the sites you develop. I often speak to developers who have the “That Wont Happen To Me” attitude that I also once had. Trust me, coming from someone who has experienced the shame of being hacked, there is nothing more embarrassing and sole destroying than your site featuring a black screen containing the words “You Have Been Hacked By …” in a 125px font.

Developers who have experienced this type of hack will know the subsequent phone call to their client is not an enjoyable one.

I urge all developers to even take simple measures to help ensure their website’s security. For example, you are able to dramatically decrease your chances of being hacked by simply removing the WordPress version number from your source code using the following action in your functions.php file:

1
remove_action('wp_head', 'wp_generator');

Although this is an extremely simple security measure and will not guarantee full security, it does help to hinder hackers.

I recommend to wise readers taking WordPress security seriously to read WordPress Security: The Ultimate Guide by Kevin Muldoon.

Display All Site Settings

When developing themes and plugins I often find myself darting over to phpMyAdmin to check and modify specific settings.

The below code removes the need to manually access phpMyAdmin for these types of mundane tasks, by simply adding an “All Settings” tab that enables users to view an extensive list of site settings found within your database related to your site.

The function also ensures that the tab is only viewable to admin users and is an excellent and time efficient way to edit global website settings.

1
2
3
4
5
6
7
// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS

function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}

add_action('admin_menu', 'all_settings_link');

Restrict Authors to Edit Only Their Own Posts and Media

Developing and managing large industry related blogs can be one hell of a task made even more challenging by the range of different authors you employ.

Often large WordPress blogs can have multiple bloggers adding media, creating posts and using the dashboard at the exact same time, and boy can it get confusing quickly.

A great way to improve your authors’ experience is to streamline their access within the WordPress Media tab. The following snippet allows authors to only view the media they have uploaded themselves, which allows for a much smoother blogging experience:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* Only See Own Attachments */

add_action('pre_get_posts','users_attachments');

function users_attachments( $wp_query_obj ) {

global $current_user, $pagenow;

if( !is_a( $current_user, 'WP_User') )
return;

if( 'upload.php' != $pagenow )
return;

if( !current_user_can('delete_pages') )
$wp_query_obj->set('author', $current_user->id );
return;

}

Replace WP Admin

Delivering to clients a unique individual experience is crucial to customer satisfaction. This can easily be achieved by adding small personal touches throughout the site and the WordPress backend.

I have found something as small as switching the WordPress logo on the login screen to your customer’s branding really helps to deliver this experience to your clients.

The code below allows you to switch the login logo to a more preferable image by simply changing the attachment id:

1
2
3
4
5
6
7
8
9
10
11
12
add_action( 'login_head', 'login_logo' );

/**
* Replaces the login header logo
*/

function login_logo() {

$image_attributes = wp_get_attachment_image_src( 1, 'full' );
echo '<style> .login h1 a { background-image: url( ' . $image_attributes[0] . ' ) !important; }</style>';

}

I recommend taking this approach one step further by addressing two other small issues. The logo by default links through to the WordPress.org website and also has the HTML title “Powered by WordPress”. The following two functions ensure if clicked the user is taken to the site’s homepage and also modifies the title tag to contain the site title.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
add_filter( 'login_headerurl', 'login_logo_headerurl' );

/**
* Replaces the login header logo URL
*
* @param $url
*/

function login_logo_headerurl( $url ) {
$url = home_url( '/' );
return $url;
}

add_filter( 'login_headertitle', 'login_logo_headertitle' );

/**
* Replaces the login header logo title
*
* @param $title
*/

function login_logo_headertitle( $title ) {
$title = get_bloginfo( 'name' );
return $title;
}

Removing Post Meta Boxes from Posts and Pages

When creating a WordPress page or post, users can often become overwhelmed by the amount of unnecessary fields found throughout the page, ranging from Custom Fields to Author Meta boxes.

Although they can be removed using the screen options drop down tab, I always make a habit of removing any fields that aren’t necessary to the website or user at the start of the project. After all why leave them there?

This extremely useful custom function makes use of the built in WordPress remove_meta_box() function. To remove a meta box that appears on both pages and posts we have to declare the function for each.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// REMOVE POST META BOXES

function remove_metaboxes() {

/* Posts */

remove_meta_box( 'authordiv','post','normal' ); // Author Metabox
remove_meta_box( 'commentstatusdiv','post','normal' ); // Comments Status Metabox
remove_meta_box( 'commentsdiv','post','normal' ); // Comments Metabox
remove_meta_box( 'postcustom','post','normal' ); // Custom Fields Metabox
remove_meta_box( 'postexcerpt','post','normal' ); // Excerpt Metabox
remove_meta_box( 'revisionsdiv','post','normal' ); // Revisions Metabox
remove_meta_box( 'slugdiv','post','normal' ); // Slug Metabox
remove_meta_box( 'trackbacksdiv','post','normal' ); // Trackback Metabox

/* Pages */

remove_meta_box( 'postcustom','page','normal' ); // Custom Fields Metabox
remove_meta_box( 'postexcerpt','page','normal' ); // Excerpt Metabox
remove_meta_box( 'commentstatusdiv','page','normal' ); // Comments Metabox
remove_meta_box( 'trackbacksdiv','page','normal' ); // Talkback Metabox
remove_meta_box( 'slugdiv','page','normal' ); // Slug Metabox
remove_meta_box( 'authordiv','page','normal' ); // Author Metabox

}

add_action('admin_menu', 'remove_metaboxes');

Conclusion

The custom functions featured in this post feature regularly within the functions.php files for my themes. My hope is that you also consider the use of them in your sites going forward.

There are absolutely hundreds of extremely useful functions that we simply don’t know exist as they have never been shared! Well this is the time to change that mentality.

I encourage all readers to share their own favorite snippets in the comments below, and just maybe, together, we can create our own “custom-functions-bible.php.”

]]>
http://premium.wpmudev.org/blog/creating-a-wordpress-custom-functions-bible-and-snippets-to-get-you-started/feed/ 10
How to Quickly Remove WordPress Widget Titles http://premium.wpmudev.org/blog/how-to-quickly-remove-wordpress-widget-titles/ http://premium.wpmudev.org/blog/how-to-quickly-remove-wordpress-widget-titles/#comments Sun, 27 Jul 2014 15:30:00 +0000 http://premium.wpmudev.org/blog/?p=130934 Recently, I was adding widgets to the footer of a WordPress site I was putting together and the widget titles just didn’t look right with the theme. The Twitter widget I was using didn’t need a title – it was obviously displaying the latest tweet.

Unfortunately, there isn’t an option in WordPress to disable widget titles (now that would be a handy little feature), but there are ways and means of getting around it.

In today’s Weekend WordPress Project, I’ll show you how to stop widgets displaying titles on your website.

Widget titles
Hide widgets titles so they don’t display on your website.

Hiding WordPress Widget Titles

For this tutorial, we’re going to use the Remove Widget Titles plugin, available for free in the WordPress Plugin Repository.

This simple plugin remove the title from any widget that has a title starting with “!”.

For example, if you want to remove the title from the Search widget, add an exclamation mark:

Search widget
Remove the title from the Search widget.

And you can turn this:

Search
Search title.

Into this:

No search
No search title.

The great thing about this plugin is that you can still include titles for your widgets in the backend, allow you to quickly distinguish them in the widgets interface without having to open them.

]]>
http://premium.wpmudev.org/blog/how-to-quickly-remove-wordpress-widget-titles/feed/ 3
What to Expect in WordPress 4.0: A Hugely Underwhelming “Milestone” Release http://premium.wpmudev.org/blog/wordpress-4-0-hugely-underwhelming/ http://premium.wpmudev.org/blog/wordpress-4-0-hugely-underwhelming/#comments Wed, 16 Jul 2014 12:00:00 +0000 http://premium.wpmudev.org/blog/?p=130687 Is it just me, or does WordPress 4.0 seem more like version 3.10?

Did someone get the numbering wrong? Did we accidentally skip to 4.0?

That must be it, because I can’t think of any other reason why such a minor upgrade to WordPress is deserving of a full version number.

WordPress 3.10
Welcome to WordPress 3.10.

WordPress news sites have lauded the “exciting new features” in this release, which is now available to download and test as a beta.

The software does come with improvements, such as the ability to select your language during installation and a grid view for the media library and plugins, but these are hardly groundbreaking features.

The fact is, users who upgrade to 4.0 when it’s released on August 27 won’t even realize there are any changes.

Nice Features… For a Point Release

We had high hopes for WordPress 4.0. So high, in fact, that we got a little excited and made our own predictions for the features in this milestone release (tongue placed firmly in cheek).

Okay, so we got a little carried away. There’s nothing wrong with getting excited about our favorite software, right? The fact is, we expected a major, milestone version of WordPress to be something special, something that would shine brighter than your average point release.

Take WordPress 3.0 for example. When it came out in June 2010 there were many reasons to be excited about this actual milestone release:

  • MU (now Multisite) was integrated into core
  • There was a new, lighter interface
  • New APIs for theme developers
  • Custom post types
  • Twenty Ten default theme
  • Bulk updates for multiple plugins and themes
  • Custom menu management
  • Shortlink support
  • Ability to set admin username and password during installation
  • Contextual help
  • Hundreds of bug fixes

WordPress 3.0 was huge. Custom post types gave developers the ability to create more than just posts and pages. Then there was the merger of Multisite into core, making it easier than ever to manage a network of WordPress site.

The lighter interface gave WordPress a more modern edge, the new default theme took full advantage of core’s features, menu management made it easier to create and customize menus…

WordPress 3.0 was a pioneering release that cemented the transformation of WordPress from a simple blogging tool into a fledgling content management system.

Now let’s take a look at the features in WordPress 4.0.

Select Your Language During Installation

In previous versions of WordPress, if you wanted to use a language other than English you had to install a localized version or manually upload translation files.

WordPress 4.0 allows you to select your language during installation without the need for downloading separate files.

Considering two-thirds of WordPress users live outside the US, this feature is a long-time coming.

Internationalization
Internationalization.

Media Grid View

You can now view the media library as a grid or as a list.

Media grid view
The new grid view in the media library.

Updated Plugin Install and Search Experience

You can now view the plugin install screen as a grid.

Plugin grid view
The new plugin grid view.

Post Editor Improvements

The menu bar at the top of the post editor now sticks to the top of the page when you scroll. This is probably the most useful feature in this release because it is really annoying having to scroll to the top of the page to access editing buttons.

Post editor
Updates to the visual editor include new sticky editing buttons.

Embeds have also been improved so users can see embeds (and not just a grey square) in the visual editor when they paste in a URL from sites like YouTube and Twitter.

Widgets Updated in Theme Customizer

Widgets were added to the Theme Customizer in WordPress 3.9. In 4.0, widgets have been moved to their own separate panel in the Customizer.

API for Customizer Panels

Not forgetting developers, the Customizer now includes a new way to group options together using panels.

Where is WordPress Going?

Internationalization is hugely important, especially considering 22 per cent of the web uses WordPress and that number is growing. Adding improved internationalization to WordPress has been a long time coming.

As for the other updates in this release, they pale in comparison to those featured in WordPress 3.0.

Since WordPress 3.8 introduced features as plugins, contributors have working fairly autonomously on projects for integration into core without actually considering the product as a whole. Developers are relentlessly pushing forward with uninspired and boring releases that don’t reflect the scale and influence WordPress has acquired four years on since WordPress 3.0 was released.

That’s not to dismiss the work of the army of contributors – all unpaid volunteers – who help build WordPress and have made it what it is. They should be commended for the huge amounts of time and effort they put into building the software.

The problem is there are a lot of people on this open source bus but no one knows there it’s going. Where’s the roadmap?

After WordPress 3.0 was released, WordPress co-founder Matt Mullenweg announced contributors would take a release cycle off to focus on the community using the software. Developers had spent so much time improving the software, it was decided to put a pause on WordPress 3.1 and support the people that had quickly grown around WordPress.

It’s time once again to put a pause on development and actually think about where WordPress is going, how we can improve the software to build better websites and actually improve the WordPress experience.

As one user in the WordPress Support Forums recently put it, “Make the foundation of the house of WordPress as good as the shiny layers of paint you keep slapping on willy nilly.”

Come back tomorrow for our take on the four features that should have been included in WordPress 4.0.

WordPress 4.0 Beta 1 is now available for download and testing. You can also use the WordPress Beta Tester plugin to access the latest bleeding edge nightly versions of WordPress.

]]>
http://premium.wpmudev.org/blog/wordpress-4-0-hugely-underwhelming/feed/ 54
Automate These 30 WordPress Tasks with IFTTT http://premium.wpmudev.org/blog/automate-wordpress-ifttt/ http://premium.wpmudev.org/blog/automate-wordpress-ifttt/#comments Fri, 30 May 2014 12:00:00 +0000 http://premium.wpmudev.org/blog/?p=129321 IFTTT is a service that lets other services or software (like WordPress, Facebook, Twitter, YouTube, ect.) talk to each and perform actions when certain things occur.

IFTTT literally stands for “if this then that,” and that’s a pretty good explanation of what it does.

For example, you can set up an IFTTT “recipe” (as they’re called) that goes something like this:

IF a new post is made on my WordPress blog THEN automatically tweet out a link to it on my Twitter account.

There are currently 108 different services or “channels” that you can hook up together. You can do all sorts of things from automatically saving your Instagram photos to Dropbox to automatically muting your phone’s ringer at bedtime.

As we’re obviously focused on WordPress here, we’ll go over 30 different recipes for WordPress and other services. These are just a sampling. You can go check out others or even make your own.

 

featured-ifttt


Facebook

1. Add a new post on your site and a link to it automatically gets published on your page at Facebook. (see recipe)

2. Links posted to a Facebook page are posted to WordPress as posts. A reminder to visit the fan page is included. (see recipe)

3. Publish a photo on a Facebook page and it gets published to your WordPress site as a photo post along with the caption, and a link to the Facebook page. (see recipe)

 

Twitter

ifttt-services-470

4. When you create a new post on WordPress, a tweet is made on your account. (see recipe)

5. When you make a tweet on Twitter, it gets posted on your WordPress site and will include a link and even a photo. (see recipe)

6. Make a tweet with a specific hashtag, and a WordPress post will be created. (see recipe)

 

Gmail

7. A new post on WordPress creates an email in Gmail with the post title, post URL, and post content. (You can set to send to specific Google+ Circles if you like. (see recipe)

8. Send an email in Gmail and have it post to your WordPress site. (see recipe)

 

YouTube

9. Upload a new YouTube video and it gets posted to your WordPress site. (see recipe)

10. When you add a YouTube video to your favorites, a new post with the video is added to your site. (see recipe)

 

Instagram

11. Add a new photo to Instagram and have it automatically posted to your site. (see recipe)

12. New Instagram photo with a specific tag gets posted to a specific WordPress category. (see recipe)

13. New Instagram videos get posted to WordPress. (see recipe)

 

Tumblr

14. New posts published to a WordPress blog get published to a Tumblr blog. (see recipe)

15. New posts published to Tumblr get published to WordPress. (see recipe)

16. Tumblr photo posts get posted to WordPress. (see recipe)

 

Evernote

ifttt-services-340-long

17. New WordPress posts get sent to Evernote. (see recipe)

18. Evernote shared link gets published as a WordPress post. (see recipe)

 

SoundCloud

19. New SoundCloud tracks are posted to your site. (see recipe)

20. New favorite SoundCloud tracks get posted to WordPress. (see recipe)

21. New SoundCloud tracks posted by people you follow get published to WordPress. (see recipe)

 

LinkedIn

22. New posts in WordPress create an update in LinkedIn. (see recipe)

23. New shares on LinkedIn create a new WordPress post. (see recipe)

 

Flickr

24. New Flickr photo gets published to your site. (see recipe)

25. New Flickr sets get published to a WordPress photo post. (see recipe)

26. Post WordPress featured image to Flickr. (see recipe)

27. Favorite a Flickr photo and it gets published on WordPress. (see recipe)

 

Google Drive

28. Make a new post to WordPress and it gets posted to a new document in Google Drive. (see recipe)

29. New posts in WordPress have title, URL, tags, categories, and dates added to a spreadsheet in Google Drive. (see recipe)

 

RSS

30. Post an RSS feed to your site. (see recipe)

]]>
http://premium.wpmudev.org/blog/automate-wordpress-ifttt/feed/ 12
Easter Eggs in WordPress: What’s There to Get Eggs-Cited About? http://premium.wpmudev.org/blog/easter-eggs-in-wordpress-whats-there-to-get-eggs-cited-about/ http://premium.wpmudev.org/blog/easter-eggs-in-wordpress-whats-there-to-get-eggs-cited-about/#comments Fri, 18 Apr 2014 12:00:00 +0000 http://premium.wpmudev.org/blog/?p=128193 What happened to Easter eggs in WordPress? Have they disappeared forever?

Since The Matrix Has You Easter egg surprised (and freaked out…) users in WordPress 2.6, there hasn’t been a single hidden feature in more than four years. That’s 13 versions of WordPress.

Easter eggs are fun to discover and provide a cheeky outlet for developers who have put a lot of time and work into a program and want to leave something of themselves behind. Easter eggs are silly and don’t often make sense, but mostly it’s fun finding one yourself and sharing it before your friends have stumbled across it.

Easter bunnies
Where are the Easter eggs in WordPress?

There’s been a lot of discussion recently about the need for a writing style guide for core. In a recent WP Shout post, WordPress co-founder Matt Mullenweg poo-pooed the idea, saying, “WP has always been opinionated software with a lot of personality. Every year or two people try to neuter it, remove a bit of its soul, and sometimes it gets through.”

That said, isn’t it sad that Easter eggs seem to have disappeared from WordPress? Is the WordPress personality Mullenweg jumped in to defend slowly being – as he put it – “neutered?”

Or are Easter eggs annoying and confusing for users who don’t understand what they are? Do Easter eggs just provide more work for developers who feel the need to remove them to prevent users finding them?

Should there be Easter eggs in future versions of WordPress? Have your say in our poll.

The Tradition of Easter Eggs in Software

Easter eggs – named after the Easter tradition of hiding chocolate eggs for children to find – have been part of software for 35 years.

The story goes that in the early days of software development, the identities of programmers were jealously guarded because software studios didn’t want their staff to gain celebrity status and eclipse the brands they had carefully created.

At the time, Warren Robinett, a programmer for Atari, didn’t exactly appreciate the lack of acknowledgement for his work. After failing to get his name into the manual for the Atari 2600 game Adventure, he snuck his name into the game itself.

The Matrix Has You

This Matrix-inspired Easter egg appeared when a user tried to compare two versions of the same revision in the post editor.

While the Easter egg was intended as a light-hearted bit of fun, there were some site admins who weren’t all that amused and sought out ways to remove it.

The Disable The Matrix Has Your plugin soon appeared.

In response to a Trac ticket seeking to remove the hidden feature, Mullenweg commented, “Gotta have a little soul” and “This ticket is a parody of every default argument people make in WordPress development.”

Lead core developer Andrew Nacin dismissed claims the Easter egg was unprofessional and refused to remove it from core, saying many big companies included easter eggs in their software.

If you haven’t seen the Matrix Easter egg, check out Victor Font’s video.

Adding Your Own Easter Eggs to WordPress

The Konami Easter Egg plugin allows you to add an Easter egg to your site and create a custom password to access the secret.

Only people who know the secret code will see your message. By default, the code is the classic Konami cheat code (up up down down left right left right b a enter) but you can change it to anything you like.

You can also customize the css to change the colors on your hidden page.

Easter Eggs for Developers

Some would argue an Easter egg still exists in WordPress, though it’s really more a developer’s shortcut tool.

If you go to http://example.com/wp-admin/options.php?option_group_id=all (replacing “example” with your site), you’ll be taken to a hidden page in your WordPress backend with lots of extra juicy options.

Should we have Easter eggs in WordPress?

Easter eggs aren’t as popular as they once were. Back in 2009 there were four updated plugins that allowed you to add Easter eggs to your site – Customizable Konami Code, WP Cornify, WP-Konami and Konami Easter Egg. Only Konami Easter Egg has been updated in the past two years.

So what do you think? Should we have Easter eggs in WordPress? Tell us below and don’t forget to vote in the poll.

Image credits: James Nash.

]]>
http://premium.wpmudev.org/blog/easter-eggs-in-wordpress-whats-there-to-get-eggs-cited-about/feed/ 1
Automattic Acquires Incsub (and WPMU DEV!) http://premium.wpmudev.org/blog/automattic-acquires-incsub/ http://premium.wpmudev.org/blog/automattic-acquires-incsub/#comments Mon, 31 Mar 2014 13:01:14 +0000 http://premium.wpmudev.org/blog/?p=126867 Big news to share with everyone today, Incsub, the parent company of this site, has been acquired by Automattic, the people behind WordPress.com!

dev+auto

I know it may come as a surprise to a lot of you, but to us, and as I was saying to Matt the other day during our weekly Turkish bath, it’s really been on the cards since the start – in fact, as we shared a sweaty handshake on the deal, he commented that the news would, in many ways, come across as ‘the sound of inevitability’.

An artists's impression of the event
An artists’s impression of the event

So, why were Automattic interested in us?

Well, besides us being the premier plugin developers on the web, having the largest read blog in the area and coming out with products that in many ways look like the future of WordPress, in fact this is more of an ‘acquihire’ – here’s how the deal breaks down.

WPMU DEV Blog Team To Take Over Haiku Production

Joe, Rae and Chris were of particular interest to the Automatticians, and will, as of today be moved entirely off writing duties here on the WPMU DEV blog, and into the critical operation of producing Haikus for various Automattic related projects.

Commenting on the move, technical expert Chris D Knowles commented:

Haiku nirvana,
Like the perfect tech wedding,
Needs patience and a beard

You can now get all your WP goodness at WP Pravda Tavern, just like God Matt intended originally.

Support Team To Attack WP.org Forums

The full force of the WPMU DEV Support team is to be thrown directly at the WordPress.org forums.

cattle-prod-development

Upon initial posting, every user will be congratulated and thanked for using the forums in under-an-hour response times, unpaid volunteer plugin and theme developers will now be harassed continually through Asana, Helpscout, Email, IM, Phone and in person until they resolve those bloody tickets.

News that WPMU DEV enforcer Timothy Bowers would be prowling the globe, cattle prod in hand, to ensure proper attention to detail and quality, was greeted with mixed emotions by existing forum volunteers.

Automattic Developers To Join WPMU DEV Team – Switch To Premium Plugins

While WordPress.com has been a successful project, clearly it hasn’t quite reached the heights of premium plugin development, and as a result Mullenweg stated that the new company would be pivoting entirely towards the production and support of premium plugins.

“It’s not quite as sexy as being a top 5 website”, Mullenweg didn’t comment, “but I feel like it’s the future, I mean without reliable, safe, always updated and improved premium plugins, how could WordPress succeed beyond being a simple blogging platform for individuals.”

WordPress.com will be quietly phased out over the next decade as the focus shifts to WPMU DEV.

Farmer To Become Audrey CEO

“Look, there’s nobody I’d trust more, or feel I’d work better with, than James – and that’s why I’d like to entrust my baby to him” Matt failed to mention when asked about probably the most exciting news so far to come out of the deal.

“I really feel that so far the company has just been flailing about, engaging in vanity projects, investing on some sort of power trip just to give me a profile” he absolutely didn’t state. “James will be able to come in, give us focus and direct our activity towards a more worthwhile and practical goal, he’s exactly the man we’ve been looking for to help me stop wasting my millions” we completely made out up afterwards.

When asked how long the transition would take, Farmer’s new deputy, Toni Schneider, suggested that it’d probably be complete ‘within the day’, before bashing off a quick email to the company lawyer.

We’ll keep you updated :)

]]>
http://premium.wpmudev.org/blog/automattic-acquires-incsub/feed/ 20
5 Reasons Why Your WordPress Business Should Have a Blog http://premium.wpmudev.org/blog/5-reasons-why-your-wordpress-business-should-have-a-blog/ http://premium.wpmudev.org/blog/5-reasons-why-your-wordpress-business-should-have-a-blog/#comments Wed, 12 Mar 2014 15:30:00 +0000 http://premium.wpmudev.org/blog/?p=126944 The line, “If you build it, he will come,” may have worked for Kevin Costner’s character in Field of Dreams, but such advice doesn’t necessarily ring true online.

It doesn’t matter how much time you spend carefully crafting a beautiful and functional site. Without visitors it may as well be a piece of paper flapping about in the breeze.

So how do you drive traffic to your site?

Blogging can offer a relatively simple way to increase your page views, build authority in your niche and connect with new and existing customers, all while promoting and reinforcing your brand.

Flock of sheep.
Start a blog and watch as readers flock to your site.

Drive Traffic to Your Site

The more traffic you have visiting your site, the more likely it is you will make a sale or score a new customer.

Not only will a blog provide your audience with interesting and useful information, it will also increase the number of indexed pages and keyword usage on your site, allowing search engines to rank your site higher in their results.

If you have a small site – say, a home page, a products/services page, an about page and a contact page – that’s only four pages for search engines to index.

Google
Every time you write a post, it’s another indexed page for your site.

Every time you write a post, it’s another indexed page for your site, and another signal to Google that your site is alive and kicking and they should be checking back regularly for new content. Every new indexed page is also another opportunity for your site to show up in search engine results and draw new visitors to your site who stumble upon your content through organic search.

If that’s not enough to convince you to blog, a Hubspot study has found businesses that blog get 55 per cent more visitors.

In the survey of 1531 small to medium-sized businesses, of which 795 blogged and 736 didn’t, companies that blogged also received 97 per cent more inbound links and 434 per cent more indexed pages.

Give Your Business a Voice

Starting a blog is a simple way to give your business a voice. It can give your audience a glimpse into your business while also promoting your products and services.

People are also more like to buy products or services from businesses they feel like they “know.” Having a blog that you regularly update will reinforce your brand and what your business stands for, allowing your readers to feel like they now you even if they’ve never met you.

Haters gonna hate.
Haters gonna hate.

It’s easy for anyone to post anything online about a business, be it good, bad or ugly. With a blog, you can manage your reputation and control – to some extent – how your business is portrayed online.

Haters gonna hate, but that shouldn’t stop you balancing any criticism targeted at your business with your own perspective, neatly outlined on your blog.

Potential and existing customers can read your posts and decide for themselves whether you are credible.

Establish Your Business as an Authority

Posting fresh content to your blog that is relevant to your niche and insightful to your customers can reinforce the idea that you know what you’re talking about and help establish you as an expert in your niche.

Blogging can help stamp your business as an authority and encourage your readers to share your content with their networks, and even motivate them to become advocates for your business.

By blogging regularly and consistently, you can build a strong and visible online presence while establishing your experience and expertise.

Foster a Sense of Community

A blog is one of the best ways to update customers on your new products or services.

Opening up your posts to comments allows you to interact with your readers and build relationships with potential and existing customers, increasing the likelihood of new sales.

Thumbs up.
Positive feedback can be the push potential customers need to buy your products and services.

Reader comments can be a key source of information for your business and for other readers. They can provide detailed and immediate feedback on your business.

Positive feedback provides an endorsement to potential customers, while negative feedback gives you the opportunity to respond to concerns and improve areas of your business.

Social media can also play a strong role on your blog. Providing links to sites like Facebook, Twitter and Google+ can encourage readers to share your content, helping you to reach a much wider audience that you would otherwise achieve.

Enjoy Long-Term Results

One hour of effort writing a post today can turn into hundreds, if not thousands, of page impressions in the future.

In a few years you could have thousands of incoming links from social media and other sites referencing your post.

New businesses trying to make their mark in your niche will struggle to compete with your thriving online presence.

A relatively small amount of work can set you up for gains later, so while you’re eating your breakfast or tucked up in bed at night, you can be safe in the knowledge you’re still driving traffic to your site.

Does your business have a blog? Has it helped increase traffic to your site? Tell us in the comments below.

Image credit: .reid.

]]>
http://premium.wpmudev.org/blog/5-reasons-why-your-wordpress-business-should-have-a-blog/feed/ 2
35+ Resources to Become a Kick Ass WordPress Developer http://premium.wpmudev.org/blog/35-resources-for-kick-ass-wordpress-developers/ http://premium.wpmudev.org/blog/35-resources-for-kick-ass-wordpress-developers/#comments Tue, 11 Mar 2014 12:00:00 +0000 http://premium.wpmudev.org/blog/?p=126338 There is a low barrier to using and working with WordPress. In fact, anyone with knowledge of PHP or with design skills can start using WordPress immediately and see results.

But if you want to really succeed with WordPress, build a strong business and gain respect, you need to be an over-achiever. Why? Because there are plenty of other WordPress developers out there who are also vying for clients and trying to earn a buck.

Luckily, there is a plethora of information available so you can move beyond the basics of tweaking a site so you can start calling yourself a fully-fledged WordPress pro. It also helps to pay attention to what the actual pros – the WordPress core developers and contributors – are doing.

So if you’re ready to kick some serious ass, read on.

WordPress Codex

codex

It goes without saying that every good developer who wants to be great references the Codex. The Codex is, essentially, the WordPress bible.

If you’ve never used the Codex before, even for the basics, like setting up a Multisite installation or for reading up on detailed information on a function, then you’ve probably been living under a rock or in a dark, dank cave, with only a generator to power your MacBook Pro.

Make WordPress Core

make-wordpress-core

Make WordPress is the official blog of the core development team for WordPress.

The site features regular updates on new features for upcoming version of WordPress. If you want to stay on top of what’s happening in WordPress, this is the place to be.

WordPress TV

wordpress-tv

If you can’t get along to WordCamps, WordPress TV is the next best thing. WordPress TV features recorded videos from WordCamps held around the world.

It’s easy to search through the site for videos on any topic, plus watching someone give a presentation can be a lot more engaging them simply reading a blog post.

WP Beginner

wpbeginner

Let’s start easy. If you think you’re too good to read a beginner site, think again. Syed Balkhi’s site is the largest unofficial WordPress resource on the web and is updated daily with new tutorials and how-tos.

While many of the site’s posts may seem too easy, and even trivial for advanced users, there are often interesting tips and tricks that are helpful for any good developer.

Tuts+ WordPress

wptuts-plus

If WP Beginner is too easy for you, then Tuts+ is the place for you. Since Tom McFarlin recently took over the editing gig at Tuts+, the site has gone full throttle with advanced topics, such as object-oriented programming in WordPress and using WordPress for web application development.

Tom McFarlin

tom-mcfarlin

Speaking of Tom McFarlin, his personal blog is a thoughtful and informative extension of his work at Tuts+. The topics he writes about are heavily geared towards programmers, but these are interspersed with posts on discussions such as The Hate and Vitriol of WordPress and Developer Distractions: The Available Tools.

Smashing Magazine

wp-smashing-magazine

Smashing Magazine is one of the first web development/design blogs I remember reading. The WordPress articles are posted almost monthly, but the site contains a large back catalog of articles by some recognisable WordPress personalities, such as Siobhan McKeown and Tom McFarlin.

The posts are usually in-depth and well-researched.

WP Mayor

wp-mayor

WP Mayor regularly publishes how-tos, just like WP Beginner. The posts are usually a mix of beginner and intermediate level stuff, with a few promotions thrown in for good measure.

ManageWP Blog

ManageWP.org

ManageWP is another regularly updated WordPress blog featuring, tips and tricks, how-tos and reviews.

The site has a lovely mix of intermediate level articles, as well as information on third-party plugins and themes.

Paulund

paulund

Blogger and web developer Paul Underwood maintains a fantastic collection of tutorials, snippets and other resources on his personal site.

His blog is a great place for intermediate and advanced level, including cool topics like Create A Clock In CSS and how to Programmatically Add Menu Item.

Pippins Plugins

pippins-plugins

If you haven’t heard of Pippins Plugins, you’ve probably just finished a stint serving time in solitary confinement. Pippin Williamson has coded so many plugins, his products alone could fill the WordPress Plugin Repository and Code Canyon. Well, almost.

Pippin’s blog is a great mix of thoughtful reviews, tutorials on advanced topics and how to use features such as the WordPress heartbeat API.

Konstantin Kovshenin

konstantin-kovshenin

Konstantin Kovshenin is a developer for Automattic and in his spare time he is… a developer for WordPress core. There isn’t much about WordPress this guy doesn’t know.

He regularly updates his blog with posts on advanced topics like Understanding _n_noop() and more reflective stuff relevant to all plugin developers like Lessons Learned from Building and Supporting a (Fairly) Popular WordPress Theme.

Otto on WordPress

otto-on-wordpress

Otto’s blog is where I go when I want to feel completely out of my depth. His blog focuses on advanced WordPress topics like Making a custom control for the Theme Customizer and Theme/Plugin Dependencies.

While his blog is updated sporadically, it’s a great place to go if you want to get stuck into the nitty gritty of code. Otto is also a great proponent of internationalization, and some of his posts look at how to make themes and plugins translation ready.

Mark Jaquith

mark-jaquith

While Mark Jaquith doesn’t post all that much on his blog, his posts are an interesting take on WordPress development from a core developer. Hopefully we’ll see more posts from Mark soon.

Andrew Nacin

andrew-nacin

Core developer Andrew Nacin rarely posts on his blog, but when he does he’s got a lot to say. Take his latest post for example, The qualities of a great WordPress contributor, which comes in at a lazy 2869 words. It’s a great read if you’re thinking about contributing to WordPress.

Hongkiat

hongkiat

Hongkiat’s WordPress category features a regularly updated stream of how-to and list posts covering everything from how to install WordPress locally and 20 WordPress Shortcodes and Plugins You Might Want To Try.

The site is well worth reading for tips and tricks or theme inspiration.

WPLift

wplift

Much like WP Mayor and ManageWP, WPLift offers a varied collection of tutorials, guides and WordPress round-ups.

WPLift posts a great weekly round-up of new, tutorials and resources published on third-party sites.

Matt Report

matt-report

Matt Medeiros’s site focuses on the business of WordPress, with a mix of interviews, tips and reflections on working in the WordPress ecosystem.

Matt is also well-known for his Matt Report podcast and in-depth interviews with WordPress personalities.

Chris Lema

chris-lema

Chris Lema’s site completely veers away from the development site of WordPress, instead focusing on the entrepreneurial aspects of using the CMS.

WP Kube

wp-kube

WP Kube is in the same vein as WP Lift and WP Mayor with its mix of list posts and how-tos.

This site is more targeted at intermediate level developers who are looking for curated information on plugins and themes.

WP Explorer

wpexplorer-blog

WP Explorer is another how-to site, with interesting content on topics such as creating a WordPress theme and customising the admin user interface.

Carrie Dils

carrie-dils

Genesis developer Carrie Dils blogs about all things WordPress, such as How to Run a Successful Affiliate Campaign Without Being a Douche to How To: Add a Logo to a Genesis Theme.

Carrie’s blog is a great mix of development and reflective articles with an emphasis on Genesis.

WPMU DEV

wpmu-dev

I would be remiss to dismiss this very site, WPMU DEV Blog! We post daily on everything from the best free themes available to reviews on plugins and WordPress services.

On Saturdays and Sundays we publish Weekend WordPress Projects, an ongoing series of quick projects you can complete in under an hour to improve your WordPress site.

WordPress Development Stack Exchange

stack-exchange

Stack Overflow is a fantastic question and answer site for programmers who are stuck and need a hand with frustrating code. The site’s dedicated WordPress area, WordPress Development Stack Exchange allows you to search through questions and tags and post your own question for other developers to answer.

Reddit

reddit

Reddit features two dedicated subreddits – WordPress and ProWordPress. The ProWordPress forum is targeted at advanced users and offers a community for developers to exchange ideas. Brad Williams from WebDevStudios creates ProWordPress, which he moderates along with Travis Northcutt and Michael Beckwith.

ProWordPress isn’t a place for beginners, so much as it is a place for developers to ask questions, seek advice and talk code.

Advanced WordPress

advanced-wordpress

With almost 5000 members, the Advanced WordPress group on Facebook is a popular place for WordPress developers to meet, share ideas and knowledge about advanced features and functionality. This is definitely not the place for beginners.

WP Tavern

wp-tavern

WordPress Co-founder Matt Mullenweg’s news site is updated daily with articles on new WordPress plugins, themes, services and events.

ManageWP.org

managewp-org

Vladimir Prevolac launched his WordPress news curation experiment, ManageWP.org last year. The site encourages WordPress users to share articles in return for up votes and community cred.

The site offers an easy way to stay on top of the latest articles published about WordPress.

wpMail.me

wpmail-me

You’re not a member of the WordPress community if you’re not subscribed to wpMailme. This weekly newsletters it published weekly and includes a curated round-up of WordPress news and articles, themes news and releases, plugin news and tutorials.

Post Status

poststatus

Post Status is another dedicated WordPress news site. It featured curated links to announcements and articles, and sometimes posts on community topics.

Torque

torque

Web host WP Engine launched its news site, Torque, last year at WordCamp San Francisco to much fanfare. The site publishes a mix of articles on WordPress and non-WordPress topics by contributing writers.

Codeacademy

codeacademy

Codeacademy offers free coding classes in languages such as PHP and JavaScript. It’s a great site if you’re learning how to code or just need to brush up on your skills.

Tree House

tree-house

Like Codeacademy, Treehouse offers online classes. The site has been gradually adding to its collection of courses and in January announced a new beginner’s course in the WordPress track. The site has since added six other WordPress courses, including How to Build a WordPress Theme and Local WordPress Development.

Wprecipes

wprecipes

Wprecipes features quick code snippets to help developers make the most of WordPress, such as How to change the title attribute of WordPress login logo and Easily delete WordPress post revisions using your functions.php file.

WPSNIPP

wpsnipp

WPSNIPP is another great code snippet site, featuring 622 snippets and counting. The great thing about this site is the accompanying comments where developers often discuss ways to alter a piece of code or add extra functionality.

WP-Snippets

WP-Snippets

WP-Snippets offers a collection of more than 200 snippets designed to make WordPress development easier.

CSS-Tricks

css-tricks

CSS-Tricks provides a comprehensive collection of snippets, tips and tricks to help developers tweak WordPress. The site contains a dedicated WordPress category, as well as sections for PHP, Javascript and CSS.

]]>
http://premium.wpmudev.org/blog/35-resources-for-kick-ass-wordpress-developers/feed/ 17
14 Handy WordPress Hacks Every Developer Should Know http://premium.wpmudev.org/blog/14-handy-wordpress-hacks-every-developer-should-know/ http://premium.wpmudev.org/blog/14-handy-wordpress-hacks-every-developer-should-know/#comments Tue, 18 Feb 2014 16:30:00 +0000 http://premium.wpmudev.org/blog/?p=126168 The great thing about WordPress is how you can extend it a hundred million ways to meet your needs. If you know your way around PHP, it’s not hard to tweak your site.

While there are thousands of plugins out there (including 140+ at WPMU DEV!), but it’s just as easy to add a snippet of code to your site for a quick fix.

I’m always discovering new tips and tricks that make WordPress easier and fun to use. In this round up, I’ve put together a 14 handy hacks, some you may have come across before, others that may be new to you, and some you wouldn’t know how to search for on Google.

Feature image
Try out these handy WordPress hacks on your site and makes things a little bit easier.

1. Force Perfect JPG Images

WordPress automatically compresses images to 90 per cent of the original. While this isn’t such a big deal for most site owners, some people, like photographers, miss this extra 10 per cent.

To ensure the images on your site are at 100 per cent quality, add this to your theme’s functions.php file:

1
2
3
4
add_filter( 'jpg_quality', 'high_jpg_quality' );
function high_jpg_quality() {
return 100;
}

2. Proper URLs

It’s a good idea to ensure your URLs are properly formed and are free of invalid characters. You can do this with the esc_url() function:

1
2
$my_url = 'http://myawesomesite.com/?awesome=true';
$url = esc_url( $my_url );

3. Shortcodes in Text Widgets

Widgets are great, but you can make them even better by enabling shortcodes in them with this filter:

1
add_filter( 'widget_text', 'do_shortcode' );

4. Delay When Your Posts Go to RSS

Have you ever published a post and then realised there was a huge mistake in the first paragraph? It’s easy enough to fix the error, but it’s too late for all your subscribers – your post has already been published in their RSS feeds.

Delay when your posts are published to RSS and give yourself time to double-check your live posts. Add this snippet to your functions.php file:

1
2
3
4
5
6
7
8
9
10
11
function publish_later_on_feed($where) {
global $wpdb;
if ( is_feed() ) {
$time_now = gmdate('Y-m-d H:i:s');
$time_delay = '15'; // integer
$time_span = 'MINUTE'; //MINUTE, HOUR, DAY, WEEK, MONTH, YEAR
$where = " AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, '$time_now') > $time_delay ";
}
return $where;
}
add_filter('posts_where', 'publish_later_on_feed');

You can change the value of $delay to whatever length of time suits you.

5. Display Featured Images In RSS Feed

A picture tells a thousand words, as they say. Encourage subscribers to visit your site rather than just read your content in their RSS feed by displaying featured images by default:

1
2
3
4
5
6
7
add_filter('the_content_feed', 'rss_post_thumbnail');
function rss_post_thumbnail($content) {
global $post;
if( has_post_thumbnail($post->ID) )
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' . $content;
return $content;
}

6. Disable HTML in Comments

Spam can be a real pain. Do you get spam in the comments of your site that are littered with links to even more spam?

Disable HTML in your comments to prevent links to spam, bold text and other spammy tactics. Just add the following code to your functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// This will occur when the comment is posted
function plc_comment_post( $incoming_comment ) {
    // convert everything in a comment to display literally
    $incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);
    // the one exception is single quotes, which cannot be #039; because WordPress marks it as spam
    $incoming_comment['comment_content'] = str_replace( "'", '&apos;', $incoming_comment['comment_content'] );
    return( $incoming_comment );
}
// This will occur before a comment is displayed
function plc_comment_display( $comment_to_display ) {
    // Put the single quotes back in
    $comment_to_display = str_replace( '&apos;', "'", $comment_to_display );
    return $comment_to_display;
}
add_filter( 'preprocess_comment', 'plc_comment_post', '', 1 );
add_filter( 'comment_text', 'plc_comment_display', '', 1 );
add_filter( 'comment_text_rss', 'plc_comment_display', '', 1 );
add_filter( 'comment_excerpt', 'plc_comment_display', '', 1 );
// This stops WordPress from trying to automatically make hyperlinks on text:
remove_filter( 'comment_text', 'make_clickable', 9 );

Thanks to Peter Keung for this great snippet.

7. Shortcut to Your Site’s URL

WordPress has a simple function that allows you to quickly reference your URL. Not only will save you having to type out your URL time and time again, it will also save you having to change your files if you ever change domains.

1
<?php bloginfo('url'); ?>

You can then use the function like so:

1
<a href="<?php bloginfo('url'); >/about">About Our Company</a>

8. Recent Blog Posts on Homepage

Display your most recent blogs on your homepage without actually making your blog your homepage with this fantastic snippet:

1
2
3
4
5
6
7
<?php query_posts($query_string . '&showposts=5' ); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="story">
<div class="story-content">
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<?php the_excerpt(); ?>
<?php endwhile; endif; ?>

You can change &showposts=5 to however many posts you want to display.

9. Customize the Dashboard Logo

Add your own logo to the dashboard in the backend of WordPress to personalise your installation. This is a great tip for customizing client sites. Just paste the following code:

1
2
3
4
5
6
7
8
9
add_action('admin_head', 'custom_logo');

function custom_logo() {
echo '

<style type="text/css"><!--
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; }
--></style>';
}

10. Remove Error Message on the Login Page

Whenever your users enter an incorrect login name or password, an error message is displayed on the login page alerting them to an incorrect piece of information. If a hacker were to correctly guess one of those pieces of information, the error message would help them identify what he/she got right.

Block hackers by adding the following filter:

1
add_filter('login_errors',create_function('$a', "return null;"));

This hack isn’t recommended for sites with multiple authors.

11. Remove Publicly Displayed Version of WordPress

Another anti-hack hack. This handy security by obscurity snippet will hide the version of WordPress you’re using, making it harder for hackers exploiting holes in older versions of WordPress.

1
2
3
4
5
6
7
<?php
// Remove the WP version for extra WordPress Security
function remove_wp_version(){ 
return ''; 
} 
add_filter('the_generator', 'remove_wp_version'); 
?>

12. Automatic Copyright Date in Footer

So many sites have outdated copyright information while others show just the current year as their copyright date.

Display your correct copyright date (e.g. © 2005-2014) with this code to your functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function comicpress_copyright() {
global $wpdb;
$copyright_dates = $wpdb->get_results("
SELECT
YEAR(min(post_date_gmt)) AS firstdate,
YEAR(max(post_date_gmt)) AS lastdate
FROM
$wpdb->posts
WHERE
post_status = 'publish'
");
$output = '';
if($copyright_dates) {
$copyright = "© " . $copyright_dates[0]->firstdate;
if($copyright_dates[0]->firstdate != $copyright_dates[0]->lastdate) {
$copyright .= '-' . $copyright_dates[0]->lastdate;
}
$output = $copyright;
}
return $output;
}

Next, you need to add this to your footer.php file where you would like to display the copyright date:

1
<?php echo comicpress_copyright(); ?>

This function looks for the date of your first post, and the date of your last post. Very cool!

Thanks to Philip M. Hofer (Frumph) of ComicPress for this snippet.

13. Set Default Editor

Do you prefer to use the HTML editor rather than the Visual Editor when writing posts? Make either of these options your default by adding either of the following lines to your functions.php file:

1
2
3
4
5
# Visual Editor as default
add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );

# HTML Editor as default
add_filter( 'wp_default_editor', create_function('', 'return "html";') );

14. Redirect a User After Login

You can redirect users who login to your site to another URL based on their role using this snippet. Just add it to your functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php function redirect_user_on_role() { //retrieve current user info global $current_user; get_currentuserinfo(); //If login user role is Subscriber if ($current_user->user_level == 0)
{
wp_redirect( home_url() ); exit;
}
//If login user role is Contributor
else if ($current_user->user_level > 1)
{
wp_redirect( home_url() ); exit;
}
//If login user role is Editor
else if ($current_user->user_level >8)
{
wp_redirect( home_url() ); exit;
}
// For other rolse
else
{
$redirect_to = 'http://google.com/';
return $redirect_to;
}
}
add_action('admin_init','redirect_user_on_role');

?>

Thanks to WP-Snippets for this great snippet.

How do you like to hack WordPress? What are you favorite hacks? Tell us in the comments below.

]]>
http://premium.wpmudev.org/blog/14-handy-wordpress-hacks-every-developer-should-know/feed/ 18
Supporting Clients After a Project Ends – and Scoring More Work http://premium.wpmudev.org/blog/supporting-clients-after-a-project-ends-and-scoring-more-work/ http://premium.wpmudev.org/blog/supporting-clients-after-a-project-ends-and-scoring-more-work/#comments Fri, 14 Feb 2014 13:00:00 +0000 http://premium.wpmudev.org/blog/?p=125230 We’ve all been there. You’ve launched a client’s site and now you’re silently high fiving yourself because it looks fantastic and the client is thrilled.

You met your deadline and you’ve got another project already lined up. The next day your client emails you asking for a small change to their site, which you happily do for him, no questions asked.

But then a couple of days later he asks for another change… And then another change after that and, of course, he expects all these changes for free and you’re not paid a cent for your time. How can you say no?

Your clients are your business – and your income – and you want to do everything possible to keep them happy, but their incessant emails and requests for tweaks are eating into your time. Time that you should be spending on other client work.

Supporting a client after you’ve launched their site doesn’t mean you have to put other work on hold. In this post we’ll go through some tips to help you avoid the common traps and foster strong relationships with your clients.

After all, a happy client can be your biggest evangelist.

Clients feature image
Don’t do a runner after the job is done. Stick around and your clients will love you for it.

Set Clear Expectations

It’s important to set out clear expectations when you agree to begin a client project and set them early. Keep in mind that it’s not just about meeting your client’s expectations, but ensuring the client also meets your expectations.

Set out guidelines for how you carry out project and state clearly when your work on a project ends and you hand over a site. This might be when a website is launched, or you may offer support in the weeks following. You should also state what happens after a project is over and what post-launch support you provide, if any.

If you’re submitting a quote for a project, you could even have something in your terms and conditions that states any changes or updates requested after a project has been signed off will be charged at your hourly rate.

Avoid confusion and frustration later down the track by outlining boundaries as early as possible with a new client, and before you begin any work. Clearly let your client know that any extra services you provide beyond what you have agreed will cost extra and outline your hourly or retainer fee.

Set expectations early in a relationship with a new client and be proactive about educating them, whether this is through agreements, contracts, FAQs, wikis or detailed emails and conversations.

Minimize Post-Launch Support

Don’t waste your time solving problems after a site is already live.

There will always be bugs that need ironing out and if you are continually coming up against a stockpile of bugs after launch it just means you’re spending too much time on production and not enough time on testing.

Rigorously test for bugs prior to launch, and if it continues to be a problem, change the way you work with future clients to allow for more time to test for problems. While this will increase the time it takes to sign off on a project, it will save you the headache of dealing with little site fixes that can build up and eat away at your time later.

There are many ways you can educate your clients so they are prepared after launch:

Train Your Client

Offer clients training in how to use their site before it’s launched during one-on-one workshops. This will give them the opportunity to learn how to update their site themselves and ask any niggling questions. A one-on-one setting will also provide a comfortable setting to allow some clients to ask all the questions they might be too intimidated to ask otherwise.

Provide Documentation

Provide thorough documentation, such as PDF guides or video tutorials. These could cover the basics of how to login to WordPress, how to write posts or how to update a page.

Editing posts and pages
WPMU DEV maintains dozens of white lable video user manuals.

WPMU DEV has a range of continuously updated, high quality, white label video user manuals for WordPress. Integrated with the WordPress dashboard, these will guide you and your users through everything they need to know, helping you cut down on support time.

Online FAQ or Knowledge Base

If there are questions your clients tend to ask time and time again, why not add an FAQ to your site? Compile a list of questions your clients commonly have and post answers to those questions in a wiki on your site.

A Phone Number in Case of Emergency

There will always be clients who panic. For real emergencies, like a site being down, you might consider giving out your phone number, but make it very clear you charge extra for this added level of service.

Support Policy

For clients who aren’t technologically savvy and wouldn’t know what to do with documentation or training, let alone login to their site, you might want to offer support as part of their agreement.

It doesn’t have to be ongoing, even a 90-day support policy could help your client settle into their new site, ask you any questions and help them feel comfortable about managing their site on their own.

Information Pack

Put together a site information pack and send it to all of your new clients. Include any training information, documentation and details about what post-launch support you provide. If you haven’t already outlined your hourly rate for support in a quote or client agreement, you may also want to include it in this pack.

Open Communication

Communication
Let your client know you invite open communication and they can ask any question.

Clients want to know you won’t abandon them when their project ends.

While clients are more likely to leave you alone to get on with the job once work get underway, it’s after the project is complete and they are trying to understand how their website works when they will start asking lots of questions.

For many clients, they are more likely to want to work with you again not because of the work you did on their site, but because of the support you gave them afterwards.

This is where it gets tricky. Often, post-project support is not paid for (unless you agreed to it earlier) and clients will expect to call on your whenever they run into a problem.

This is when your phone starts ringing and your inbox starts filling up with emails.

It’s polite to answer all of their questions, respond quickly and spend as much time as you have available to post-project support, in theory. Often, clients might assume what they are asking for is simple when it’s actually quite tricky, or they might assume something is difficult when it will take you five minutes to implement.

This is where communication is important. You want your client to understand what is involved in fixing an issue so they know they are taking up your time.

If you’re finding that a client is emailing you incessantly, don’t sit on your email all day. Turn it off and only check it at set times, maybe first thing in the morning and again before you clock off for the day.

Immediately replying to client emails fuels the expectation that you are at their beck and call and you aren’t so busy you can’t deal with their problems and immediately implement their changes.

Don’t Give Away Your Time For Free

Just because your client’s site has launched, it doesn’t mean your time is now available for free.

If you have clients who constantly email you, tell them you would love to help them but you can’t devote all of your time to answering their questions thoroughly as that would be unfair to your paying clients. Tell them you would happily answer all of their questions for an hourly fee.

If you have a high maintenance client, put them onto a support retainer post-launch. That way, they can ask all the questions they want and you get paid. If they don’t want to pay for a retain, they don’t get support.

Clients can’t expect you to be available 24/7 without paying at some point. It’s like calling a doctor and expecting him/her to drop everything to put a Bandaid on your knee.

Always charge for changes. If a client emails you asking for a tweak, simply tell them, “I would love to do <insert change here> for <insert your hourly rate here>.”

You might be surprised by how many clients are happy to pay right away to get a job done. Sometimes it may seem like a client is asking for a change or tweak for free when they are not. They just don’t know how to ask for a quote.

Nurture Client Relationships

Client
Make time for your client and they will make time for you.

Happy clients are more likely to be return customers and give you great referrals.

Not only will having a great relationship with your client ensure your current project is a success, but it will also make it more enjoyable. It will also increase your chances of scoring further work or referrals when the project is finished.

Getting along with your client doesn’t necessarily mean talking about work all the time. Get to know their likes and dislikes, ask them about their weekend or their family. Show interest in their life as well as their work.

It doesn’t hurt to send a thank you card to a client after their site has launched. Not only will it show them you are thoughtful, but also that their business means a lot to you

You might even want to call them out of the blue a few months after launch and see how their site is doing, or even drop into your client’s office to say hello or invite them out for coffee.

Being personable takes little effort, yet leaves a lasting impression. An impression that could score you more clients.

What are you tips for supporting client? Are your clients a pleasure to deal with, or do you often run into troubles? Tell us in the comments below.

Image credits: picjumbo.

]]>
http://premium.wpmudev.org/blog/supporting-clients-after-a-project-ends-and-scoring-more-work/feed/ 2