Wordpress theme for Pegasus Magazine. Built off of UCF's Generic Theme.
- WordPress 4.4+
- Map Cap (see notes)
- Gravity Forms
- WP Rest API (version 2.0-beta13.1 or greater)
- Set user capabilities for custom post types via Map Cap. See notes below.
- Configure Cloud.Typography projects for Development and Production environments.
- Set an active issue in Theme Options. See Theme Help for more info.
This theme has a built-in Developer Mode that should be activated while stories and issue covers are in development. Update the Developer Mode setting in Theme Options to activate or deactivate Developer Mode.
HTML markup is also updateable with this method; if the WYSIWYG editor is blank and a dev directory is specified, you can work off of a file of schema 'post-slug.html' in that directory instead of copy+pasting the markup with each update.
Note that Developer Mode should be turned off for non-development environments.
As of v3.0.0 of this repo, this theme uses a "versions" concept to load functions, templates and assets conditionally, depending on the story/issue being requested. Versions allow us to maintain backward-compatibility with stories that were written using custom markup and/or code that is heavily dependent on outdated assets. Versions are assigned to issue posts as a custom meta field value; available values are defined with the
EARLIEST_VERSION constants in
functions/config.php. These versions correspond to contents in a
versions/ subdirectory. Ideally, versions values should line up with with major git tags on the theme (e.g. git tags of 3.x.x+ should have a
LATEST_VERSION value of 3), though this is not technically required. See the readme in each version directory for more details on those versions.
Create a New Version
To create a new version, copy the latest version directory in
versions/ and rename it, then update the
LATEST_VERSION value in
gulp-config.json. Make any changes to the newly-copied code as necessary. Deploy repo with new version code, then assign the new version to newly-created issue posts in WordPress.
Stories, Issues, Photo Essays Capabilities
This theme uses the Map Cap plugin to set user capabilities for custom post types. See recommended schema below.
For custom post types in this theme to be usable for users that are not super admins, this step MUST be performed upon theme activation.
- (Photo Essay ONLY:) Editor
This theme is configured to work with the Cloud.Typography web font service. To deliver the web fonts specified in this theme, a project must be set up in Cloud.Typography that references the domain on which this repository will live.
Development environments should be set up in a separate, Development Mode project in Cloud.Typography to prevent pageviews from development environments counting toward the Cloud.Typography monthly pageview limit. Paste the CSS Key URL provided by Cloud.Typography in the CSS Key URL field in the Theme Options admin area.
This site's production environment should have its own Cloud.Typography project, configured identically to the Development Mode equivalent project. The webfont archive name (usually six-digit number) provided by Cloud.Typography MUST match the name of the directory for Cloud.Typography webfonts in this repository!
Install the https://github.com/UCF/WP-Allowed-Hosts wordpress plugin if media import fails. After installing the plugin update the Allowed Hosts under the admin Settings menu. Use the following regex
\.ucf\.edu$ and check the regex checkbox.
Custom Post Types
- Issue - a post reference to an overall group of stories. Acts as the home page for Pegasus when a particular issue is active (via Theme Options.)
- Story - a single story, categorized by the issue taxonomy.
- Issue - grouping mechanism for stories. Note that the slugs for these must match their equivalent Issue post slug exactly.
- image - returns the URL of an image uploaded as an attachment for the post.
- static-image - link to an image in the theme's static directory. (Requires extension)
- media - if found, returns the URL of some arbitrary media in the media library that is an attachment of the current post. Should only be used for media types that can't be returned via [image] or [static-image].