November 15, 2014 - Custom Content, Editor Tips, How to

WordPress Externships system

Working version now at https://insidelaw.gsu.edu/externships/

Admin page "Externships" on dashboard, allows "Bulk Actions" of "Edit" to set (but not reset[a]!?!) categories, type and semesters.

Bulk edit can also place selected Externships into "Draft" status to hide from listings

Two complete systems - the "default" posts listings and the "shortcode-implemented" "selector" Opportunities listing.

Default system: https://insidelaw.gsu.edu/externships/sites/

Implemented with shortcode built in to Custom Content Type Manager

(CCTM) shortcode:

[summarize_posts post_type="externship" orderby="post_title" order="ASC"]

(also a simple search form [externship_search] )

Opportunities Selector system: https://insidelaw.gsu.edu/externships/opportunities/

Implemented with Shortcodes UI plugin.

Shortcodes:
  • [externship_page] - creates the initial page with "By..." search boxes. Via jQuery "load" AJAX functions, the bottom of the screen is populated with search result from page https://insidelaw.gsu.edu/externships/results/ - this page is hidden from search results[1]
  • [externship_results] - makes selected listings - embedded in the /externships/results/ page pulled in via AJAX into /externships/opportunities/ - if JavaScript is off, this page will be loaded directly. The AJAX capabilities are implement with a custom "Raw Content" template[2]
  • [  externship_reset_semesters  ] - {remove spaces!} clears out all assigned semesters (DANGER WILL ROBINSON!!) - this shortcode is embedded in the reset page: https://insidelaw.gsu.edu/externships/reset-semesters/ which is password protected with the "password" "delete"
  • [externship_category_cloud] - shows "externship_menu" from options table, creates a "cloud" of practice areas.

Technical overview

The "externship" post type was created by CCTM - there are no custom fields, but we do have custom taxonomy set up.

Three taxa were created with WCK - Custom Fields and Custom Post Types Creator[3]:

  • externship_semester
  • externship_type
  • externship_category (Practice area)

Four icon are stored in the /wp-content/uploads/2014/07/ folder that match the "slug" of each of the four semester "categories". The filenames are "slug-.png" - note the added trailing hyphen. These icons show in the externship-single.php page and the search results on /externships/results/ page [externship_results] shortcode.

The [externship_results] shortcode uses four entries in "options" table (edit via "My Sites / Network Admin / Sites / Edit / Settings (tab)):

  • Externship List Head - HTML of the top of the search results table
  • Externship List Row - one row of the search results table
  • Externship List Foot - close off the table

Used by [externship_page] on /externships/opportunities:

  • Externship Page Top - used HTML of the table on the top of the page - substitutes in link lists held in variables $ext_sems, $ext_cats and $ext_types

There is also a currently unused global "Externship Menu" entry that is placed at the top of the HTML returned by the [externship_category_cloud] shortcode.


[1]  see "Hiding pages from search results" for more information

[2] see "AJAX Raw Content temple" for details

[3] WCK also has a Custom Fields Creator and a Custom Post Type Creator, both currently disabled, that could have been used to create the "externship" custom post type. CCTM seems a bit more complete (except for a taxonomy creator!) and otherwise more stable and mature. WCK is under active development and we can switch to it at any time.

[a]This is a known limitation of WordPress - workaround patches/plugins are not feasible.

Comments are closed.