Featured Content: Getting Started

Ahead of our first official office hours, here is an overview of what I would like to discuss:

What is Featured Content?

Obenland discussed the high-level concept here: https://gist.github.com/obenland/3010432c8edcfcbf95a9

To me, Featured Content is a flexible way to show one or many posts in one or many places in your theme. A blogblog (versus network, site) might have 1 featured post area that will support 1-4 posts, as an example. A more complex site using WP as a CMS might program its homepage using many “featured areas” that contain varying numbers of post-like entities.

Featured Content, in the end, is just a way to return posts chosen by a content producer. The way in which featured content is selected should be intuitive, easy to manage, and use existing WP technology/terminology whenever possible. A featured post-like thing should an entity that points at a canonical post, while having the ability to override any of the parent post’s attributes on display. Example: I should be able to use a different title and image for a post that is featured when it is rendered in a featured area.

I should also be able to schedule featured items, much like I can schedule a post.

How are we going to implement it?

Here are my ideas:

I think we can get a lot of immediate mileage using a custom taxonomyTaxonomy A taxonomy is a way to group things together. In WordPress, some common taxonomies are category, link, tag, or post format. https://codex.wordpress.org/Taxonomies#Default_Taxonomies., working name: “Featured Area” and a custom post typeCustom Post Type WordPress can hold and display many different types of content. A single item of such a content is generally called a post, although post is also a specific post type. Custom Post Types gives your site the ability to have templated posts, to simplify the concept., working name: “Featured Item”. By default, a function like `wp_get_featured_content()` can return all featured posts. Passing a parameter can return posts matching that featured area slug that are published – `wp_get_featured_content( ‘mini-headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes.’ )`. A custom taxonomy can be registered to post and featured_item. Themes can register the taxonomy for more post_types as necessary.

The pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party, in its current form, implements all of the above: https://wordpress.org/plugins/wp-featured-content/

Things to consider:

  • How do we always keep the post and its featured_item brethren in sync?
  • Do featured_items and posts always share the same post_status? Should they be independent?
  • How do themes opt in to multiple featured areas if the terms have not be created for the featured_area taxonomy?
  • What are alternate ways to implement the above?

#3-8, #featured-content