WordPress

last person joined: 2 days ago 



A place for nonprofit WordPress developers and content managers of all skill levels.
The WordPress group is an engaged network of WordPress developers and content managers, for all skill levels, by WordPress users for WordPress users, to encourage the usage of and advocate for WordPress.

Our goal: to support nonprofit organizations using (or interested in using) WordPress. Additionally, this is a safe and friendly place for beginning WordPress developers and users to ask questions and connect to like-minded people.

Current organizers: Cindy Leonard, Jason King, and Mark Root-Wiley
Short link: http://community.nten.org/wordpress
Anyone can join and contribute to this group! Just create an account to get started.

Topic: WordPress Question of the Month - October 2016

1.  WordPress Question of the Month - October 2016

Posted Oct 03, 2016 17:36

Hello WP community members and happy October!  

Here's the "WP Question of the Month" (okay, so technically it's three questions...lol):

Do you build custom content types?
If so, do you do it manually or with a plugin?
What do you use custom content types for?

I look forward to hearing your answers and advice for the group!

Cindy

------------------------------
Cindy Leonard
Consulting Team Leader
Bayer Center for Nonprofit Management
Pittsburgh, PA
------------------------------


2.  RE: WordPress Question of the Month - October 2016

Posted Oct 03, 2016 21:10

For those of you whose answer is, "HUH!?", I thought I'd very quickly summarize what a custom post type is. You may have them on your site and not even know it!

From Plethora of Posts: A User-Friendly Introduction to Custom Post Types:

You already know about Posts and Pages in WordPress, right? Guess what? Those are post types.

8BT6T76Rf62jFNcdCZZz_standard-post-types.png

These standard post types are part of the default WordPress setup.

The article continues:

Custom post types are just like standard posts or pages, except for:

  • They’re not part of a default WordPress install
  • You create them as you need them (or, in WordPress vernacular, register them).
  • Think of custom post types as a way to differentiate types of content on your site.

...

How do you know when you need to create a custom post type as opposed to use the standard post and pages built into WordPress? Well, a good rule of thumb is whether you have (or plan to have) a plethora of posts.

Let’s look at some everyday examples where a custom post type might come in handy:

  • Books
  • Movies
  • Real estate listings
  • Restaurants
  • Discographies
  • Products

So if you have "Events" or "Products" or "Services" or "Cats" (!) listed in your admin menu, those are probably custom post types!

Using CPTs is a great way to take your site to the next level and make it easier to manage in the long-term. I hope you all can share what custom post types you're using and how you set them up!

------------------------------
Mark Root-Wiley

MRW Web Design / MRWweb.com / @MRWweb
Thoughtful WordPress Website for Nonprofits & Mission-Driven Organizations
Seattle, WA



3.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 03:49

Do you build custom content types?

Yes, on most websites.

If so, do you do it manually or with a plugin?

These days I code it manually. But I used to use a plugin called CustomPress (bought from WPMU Dev).

What do you use custom content types for?

  • Directory for the public to rate and review local health services 
  • Document libraries
  • Various components of an Intranet
  • Membership directory of local woodturners

Every time, it wasn't just the Custom Post Type that was required, Custom Fields and Taxonomies were too.

------------------------------
Jason King
WordPress Web Developer
Freelance
Laure-Minervois
www.kingjason.co.uk

Twitter: @jasoncsking



4.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 09:42
Mark:  Thanks for clarifying custom post types for the group.  Do you have a link for a good tutorial, by chance?

Jason:  I'd love to see links to pages that you've created that are being generated by custom post types like the ones you mentioned.

Custom post types are one of those things that, while I know exist in WP, it generally doesn't occur to me to use them.  I think seeing some good examples might generate ideas on how that feature could be leveraged.

Cindy


Cindy Leonard, Consulting Team Leader
Bayer Center for Nonprofit Management at Robert Morris University, 
339 Sixth Ave, Ste 750, Pgh, PA 15222
p 412-397-6007 | f 412-397-6016 | leonard@rmu.edu | www.bcnm-rmu.org


It's time for TechNow! Register today to receive Early Bird rates! www.technowconference.org





5.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 10:56
Cindy,

This is a pretty good tutorial: http://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/ - a bit dated but still valid. Of course, there is official WP resource - https://codex.wordpress.org/Post_Types

I first used Custom Post Type in 2009/2010 for a project. CPT is one of my favorite features of WP - it makes working with WP so much easier, fun and flexible. We use CPT in most of the projects.

Examples:

1. http://www.parentcenterhub.org/resources/ - here Resources is a CPT. Each resource has 2 attributes - title and body.

2. https://maec.org/about/staff/ - here Staff Members is CPT. Each Staff Member has attributes - Full name, bio, title, image, order and category (staff member, executive officer or board member)

Hope this helps.

Amar
--
Amar Trivedi | AmDee LLC | Phone: (240) 342-6271 ext. 700
Twitter: @AmDeeLLC | LinkedInlinked.in/amartrivedi/





6.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 14:59
Pretty neat stuff!  Thanks for sharing the tutorials and the examples, Amar!

Cindy

Cindy Leonard, Consulting Team Leader
Bayer Center for Nonprofit Management at Robert Morris University, 
339 Sixth Ave, Ste 750, Pgh, PA 15222
p 412-397-6007 | f 412-397-6016 | leonard@rmu.edu | www.bcnm-rmu.org


It's time for TechNow! Register today to receive Early Bird rates! www.technowconference.org





7.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 15:15

A couple of examples of custom post types, taxonomies and custom fields:

1. Healthwatch Derbyshire

The hospitals and surgeries are a Custom Post Type called "Local Services". We needed a custom post type because these don't fit the model of a normal post or a page in WordPress.

The list of care homes, dentists etc is a Taxonomy. In other words, these are categories that are only apply to the custom post type.

The five star rating is a Custom Field. The phone numbers, addresses etc of each local service are also custom fields.

These are all created by code in a custom-built plugin that I coded specifically for local Healthwatch organizations.

2. Register of Professional Turners

The Custom Post Type is for individual woodturners.

The Taxonomy is the type of woodurning offered e.g. bowls and platters, or antique repairs.

The Custom Fields include their address, email, phone number and website address.

------------------------------
Jason King
WordPress Web Developer
Freelance
Laure-Minervois
www.kingjason.co.uk

Twitter: @jasoncsking



8.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 15:18
Also very cool!

How did you get the ratings feature in there - is that another plugin?

Cindy

Cindy Leonard, Consulting Team Leader
Bayer Center for Nonprofit Management at Robert Morris University, 
339 Sixth Ave, Ste 750, Pgh, PA 15222
p 412-397-6007 | f 412-397-6016 | leonard@rmu.edu | www.bcnm-rmu.org


It's time for TechNow! Register today to receive Early Bird rates! www.technowconference.org





9.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 15:29
Yes, I'm with Cindy. "How did you get the ratings feature in there?" 

I get the drop down, but how does it aggregate the ratings into the overall average of all the ratings?





10.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 17:34

The plugin does this:

  • Creates custom post type for local services
  • Plus taxonomy. Assign Icons to each category (hospital, dentist etc) for visual interest. 
  • Changes how commenting works. Custom fields can easily be added to comments - something I hadn't been aware of before. There's a field for an overall star rating, plus optional fields for rating specific aspects of local services.
  • A field is added to comments to give the local service a right of reply to specific feedback. This can only be added via the dashboard.
  • Customisation of the dashboard to display all this info more clearly.
  • The plugin creates templates, shortcodes and widgets to enable all this custom info to be displayed on the website.
  • If the website uses Bootstrap, the plugin's output looks smarter, but will work without it.
  • PHP + very basic maths is used to work out average ratings and Font Awesome provided the star icons.
  • There's also a template that enables a local service to put a Trip Adviser style iFrame on their own website, to show off their rating.

I've deliberately coded it all manually so that the plugin can be installed on any website and still work, without them needing other plugins active. However, if we install the Ajax Search Pro plugin then we get a much fancier search experience, as on healthwatchbucks.co.uk.

This took me a few months to build. An exhausting process. But worth it, because I'm now selling the plugin to other Healthwatch organisations. There are still some faults, for example a few places where the theme and plugin are too intertwined, but working on that.

------------------------------
Jason King
WordPress Web Developer
Freelance
Laure-Minervois
www.kingjason.co.uk

Twitter: @jasoncsking



11.  RE: WordPress Question of the Month - October 2016

Posted Oct 04, 2016 18:32
Jason,

I stand impressed!

I'm glad you're getting some pay back for the effort!






12.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 00:23

Largely for my own curiosity, I compiled the names of custom post types from 13 of my sites (most of what I've done in the last 2 or 3 years). Hopefully the breadth gives people a good idea of what "CPTs" are good for. Listed roughly in order of frequency:

  • Events (most common by far)
  • Resources
  • Staff / People
  • Jobs
  • Projects
  • Initiatives
  • Campaigns
  • Successes
  • Partners
  • Testimonials
  • Products
  • Statistics
  • Kittens (Just kidding. Who's made it this far? Hi, Cindy!)
  • Reports
  • Articles
  • Services
  • Case Studies
  • Schools Hospitals
  • Wildways
  • Employers

You can see how many of these might be used on a "common" nonprofit site.

As for resources, the coders in the room can't go wrong with Justin Tadlock's tutorial "Custom Post Types in WordPress." This may sound silly, but that tutorial is practically famous among coders because of how many people learned about CPTs from it. Highly recommended!

------------------------------
Mark Root-Wiley

MRW Web Design / MRWweb.com / @MRWweb
Thoughtful WordPress Website for Nonprofits & Mission-Driven Organizations
Seattle, WA



13.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 04:04

Interesting that Events tops your list, given that there are so many plugins and third party solutions already available to handle this. How come you do it that way?

Kittens, well obviously.

------------------------------
Jason King
WordPress Web Developer
Freelance
Laure-Minervois
www.kingjason.co.uk

Twitter: @jasoncsking



14.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 09:05

This is a great discussion.

I don't have much to add in terms of tutorials - and there's plenty of stuff out there if you Google.

I use the Custom Post Type UI plugin for prototyping new custom posts types, but then convert to code once I'm happy.  This stops clients going "Oooh, what's this" and removing things that they shouldn't.

I've not gone to the effort of creating a list, but I've used them for lots of things similar to Mark.  Of the top of my head and in no order in particular:

  • Logos/supporters/ (for use in a slider showing supporters)
  • Countries (where these need to be more than a taxonomy because they have their own content or meta data)
  • Minorities
  • Issues and Topics (again, where they have their own content/meta)
  • Resources
  • People/staff
  • Events
  • Locations
  • Groups
  • Group documents
  • Notices
  • Campaigns
  • Directory entries
  • Publications
  • Growers (for a coffee co-operative website)
  • Badges (this was interesting!)

I'm sure there are lots more. I built one site that, behind a login, had a discussion interface a bit like a Facebook wall or simple forum that was a custom post type with comments.

Some of these things existed before you could put meta data on custom taxonomies, and I would probably implement them as taxonomies now. 

Sites that have a prominent use of these things include:

1) Minority Rights (and the micro-site for their annual report: http://peoplesunderthreat.org/) - these have lots of information about countries and the indigenous minority populations that inhabit them. The directory in particular shows off how these are more than just taxonomies.

2) Speaking of directories, this really simple site for a local branch of our mental health charity Mind has a directory that made from a CPT and custom taxonomies: http://lambethandsouthwarkmind.org.uk/directory/  This is quite old now and one of the first things I built with CPT's.

3) I won't even start trying to explain the data modelling behind the vast Bretton Woods Project website, but see if you can spot what might be a CPT!

4) Here's an example of a "Resources" post type in action - with associated meta data, taxonomies and filtering: http://avaproject.org.uk/resources/

As a quite-technical aside, I'm a bit of a coder Geek, and it may be interesting to know that I like to "abstract" the functions that WordPress gives me on a per-post-type basis to make my code simpler and easier to look after.  As an example, I may want to fetch a list of posts to populate a dropdown to select things from.  With WordPress's functions and API's you might do something like this:

$things = new WP_Query([
  'post_type' => 'thing',
  'posts_per_page' => -1,
  'order_by' => 'title',
  'order' => 'ASC'
]);

(or the get_posts() equivalent)

But I use a little library that helps me write things like:

$things = Thing::get_all();

or

$fancy_things = Thing::get_by_meta('fancy', 'yes');

The code that I use to do that is here: https://github.com/rosswintle/Oikos-Post-Types - there are other (sometimes better) ways of doing this.

The main thing is, if you're using lots of custom post types, you can really help yourself by organising your code well and not just having a single enormous functions.php

Hope that's helpful!

Ross

------------------------------
Ross Wintle



15.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 09:11

Ross,

Thanks for the tip / trick for keeping functions file small. Will definitely implement it on the next large project.

Amar Trivedi






16.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 11:20

To answer Jason's question, Event is a great example of how a plugin can register a custom post type for us and provide all the benefits without requiring any code. I always use The Events Calendar which creates an Events post type (along with Venues and Organizers as well).

Other plugins that I've had create custom post types for me include:

------------------------------
Mark Root-Wiley

MRW Web Design / MRWweb.com / @MRWweb
Thoughtful WordPress Website for Nonprofits & Mission-Driven Organizations
Seattle, WA



17.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 11:55
Another amazing list - thanks for sharing all this info!

Cindy

Cindy Leonard, Consulting Team Leader
Bayer Center for Nonprofit Management at Robert Morris University, 
339 Sixth Ave, Ste 750, Pgh, PA 15222
p 412-397-6007 | f 412-397-6016 | leonard@rmu.edu | www.bcnm-rmu.org


It's time for TechNow! Register today to receive Early Bird rates! www.technowconference.org





18.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 15:00
Well, I must say my brain hurts (in a good way) after working to incorporate this new possibility machine of CPT! It's wonderful to find out what you don't know. Especially when that's followed up by, "here's how to know and do it!" 

This has easily been the most helpful email thread I've had come into my office for weeks!

Thanks everyone for your contributions. 





19.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 11:54
What a fabulous list!  Thanks for this.

And yes, if my cats had a website, I'd probably have to use custom post types for their bios page.  :)

Cindy

Cindy Leonard, Consulting Team Leader
Bayer Center for Nonprofit Management at Robert Morris University, 
339 Sixth Ave, Ste 750, Pgh, PA 15222
p 412-397-6007 | f 412-397-6016 | leonard@rmu.edu | www.bcnm-rmu.org


It's time for TechNow! Register today to receive Early Bird rates! www.technowconference.org





20.  RE: WordPress Question of the Month - October 2016

Posted Oct 05, 2016 17:05

Great questions Cindy! Love this thread.

Do you build custom content types?

All the time. I think that's what makes WordPress so fantastic. If you can think it up, you can probably build it.

If so, do you do it manually or with a plugin?

I almost exclusively build custom post types manually. But it's what I do for a living, so it makes sense to do. It gives me complete control over what I'm creating, and let's me sleep at night knowing that, if something breaks due to a WordPress update or whatever (I've seen this more than once) I can fix it and not have to wait for a plugin update to fix the issue.

If I worked for an org that didn't have a developer on staff, I'd have no issue using a plugin to create post types. But I would 100% definitely research the plugin to assure it has a good history and the likelihood it'll be supported in the future. But the beauty of WordPress is the vast amount of tools available to let content producers create beautiful things! So use the resources available, and do it after doing your due diligence on the tool you're going to use. Read the plugin reviews, see its history... When was the last time it was updated? Is it compatible with the latest WP version? And so on.

All that said... Even if you are going to manually create your custom post types, plugins to do this still have their role. They're great for quickly prototyping. I did this a few months ago for a project at NTEN. It was awesome to show folks an almost functional web app so they could decide if web dev was on the right track. When we decided it was, I used what I learned building the post type with the plugin, and just went ahead and recreated it manually, adding additional features that wouldn't have been possible otherwise. It was definitely worth the time investment.


What do you use custom content types for?

Pretty much everything you see on nten.org is custom. The only thing that isn't, I believe, are pages. 

Awesome thread!

------------------------------
Dan Fellini
Web Development Manager
Nonprofit Technology Network
Portland, OR



21.  RE: WordPress Question of the Month - October 2016

Posted Oct 06, 2016 07:05

I use Custom Post Types on just about every single website I create. I believe it strongly helps for ease of site management for the client which is what we really focus on for the non-profits we work with. We code them in manually since we try to limit the number of plugins we use.

Alliance Rally is one site where we used them for their conference sessions - these are custom post types with taxonomies to filter and custom fields to show the session details. The faculty page is also a custom post type.....

Now that I think about it - I cannot imagine a website where I would not use them, I am kind of obsessed with them!

------------------------------
Jill Caren
2 Dogs Media, LLC
jill@2dogsdesign.com
732.241.5365