1. Skip to Navigation
  2. Skip to Content
our blog

Archive for Wordpress Category

WordPress: Send Notification E-mails On Publish

We recently developed a site for a client that allows visitors to submit their stories using a custom form. The stories then go into a queue to be reviewed for approval by an Administrator. One requirement was that these user’s be notified by email if their story was approved.

After not finding any plugins designed specifically to do this, I cooked up a little function that I thought I would share.
(more…)

How to Add Custom Fields to Media in WordPress

Sometimes a WordPress project calls for custom fields on Media. We recently built a custom gallery widget that involved uploading multiple images that would have a caption, a heading, the ability to selectively output the image, and the ability to set the hex code color of the text that was output.

To achieve this, I created a custom field on images that would allow you to input a value to be used as the color for the text and a custom checkbox to indicate to output the image.

There are two steps to this:

  1. Add the custom field to the edit screen,
  2. Process that field when saving / updating the media item.

(more…)

WordPress: How to Exclude Categories From the Archive Widget

Updated: 5/2/2012

We love developing in WordPress. For many of our clients, there is no need to reinvent the wheel and WordPress can be a significant time saver.

WordPress is a very thoroughly developed platform – yet every now and again we bump into desired functionality that isn’t readily available, such as excluding categories from the Archive Widget.

Recently, I developed some code to do just that and thought I would share it.
(more…)

WishList Member: How to Determine if User Has Pay-Per-Post Access to Content

    Updated: 5/14/2012

    There are a lot of good membership plugins out there – we recently finished building a site for a client using WishList Member and ran into a problem when trying to determine if the logged-in user has access to a given piece of Pay-Per-Post content.

    There are a couple of key features that made WL Member ideal for this project:

  1. It allows the purchase of content on either a per-post or subscription basis
  2. It blocks access to Private Media by using htaccess to route the requests through a PHP script

This project called for us to only output links to attachments if the logged-in user had access to the content, and to do so in list views after the Read More tag was output.
(more…)

WordPress: Only Show Authors Their Own Posts and Media in the Admin Area

Updated: 5/13/2012

I’ve helped our clients set up a lot of membership sites; one common request is that members are able to submit articles within WordPress.

Out-of-the-box WordPress can get you pretty far but commonly I run into two roadblocks with the default roles:

  1. The Contributor role doesn’t let Contributors see the Media Library
  2. The Author role lets Authors see everyone’s Media & Posts

While more often than not a plugin is the way to go for a full-on membership site, there’s a really quick fix that will let you assign users to the Author role and be able to hide other’s Media & Posts from them.
(more…)

How To Add A Lightbox To A WordPress Gallery

Updated: 2/29/12

I wanted to setup a simple lightbox photo gallery on a WordPress site (v3.2.1, tested and working on 3.3.1) and, to avoid installing a slew of plugins, I put together a little gallery shortcode function using the built-in WordPress gallery shortcode as my starting point. I’m a big fan of PrettyPhoto, so I modified the output of the gallery shortcode to include a rel= attribute for PrettyPhoto galleries. (more…)