Theme Files and Setup - Twentyfourteen Child

Introduction

The Toynbee Prize site is using a child theme based on the Twentyfourteen theme. The child theme file only contains those styles and functions that overwrite the Twentyfourteen defaults. Make all desired changes within the child theme files.

The child theme developed for the Toynbee Prize website is under version control at https://github.com/ToynbeePrizeFoundation/theme_twentyfourteen_child.

Theme Files

This section gives a brief description of the changes in the various files contained in the child theme.

category.php

Modified so as not to display the category name and description.

config.rb

Configuration files for using Compass to write SASS rather than CSS directly.

content.php

Modified to display excerpt rather than full posts for search results and tag archives.
[<?php if ( is_search() || is_tag() ) : ?>
<div class=”entry-summary”>]

content-with-author.php

Content template for displaying the Author on Pages. Was used for the “Perspectives on Global History” page, though currently not in use. Used with “single-with-author” page template.

functions.php

Added 2 function: 1. Guest Author Function:

/* Add Guest Author Capabilities */

add_filter( ‘the_author’, ‘guest_author_name’ );
add_filter( ‘get_the_author_display_name’, ‘guest_author_name’ );

function guest_author_name( $name ) {
global $post;

$author = get_post_meta( $post->ID, ‘guest-author’, true );

if ( $author )
$name = $author;

return $name;
}
  1. RSS icon to font-awesome
/* Add RSS Icon for Menu Bar */

add_filter( ‘storm_social_icons_networks’, ‘storm_social_icons_networks’);
function storm_social_icons_networks( $networks ) {
$extra_icons = array (
‘/feed’ => array( // Enable this icon for any URL | containing this text
‘name’ => ‘RSS’, // Default menu item label
‘class’ => ‘rss’, // Custom class
‘icon’ => ‘icon-rss’, // FontAwesome class
‘icon-sign’ => ‘icon-rss-sign’ // May not be available. Check FontAwesome.
),
);

$extra_icons = array_merge( $networks, $extra_icons );
return $extra_icons;
}
  1. Add Function to display coauthors
function twentyfourteen_posted_on() {
if ( is_sticky() && is_home() && ! is_paged() ) {
echo ‘<span class=”featured-post”>’ . __( ‘Sticky’, ‘twentyfourteen’ ) . ‘</span>’;
}

// Set up and print post meta information.
printf( ‘<span class=”entry-date”><a href=”%1$s” rel=”bookmark”><time class=”entry-date” datetime=”%2$s”>%3$s</time></a></span>’,
esc_url( get_permalink() ),
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() )
);

// get the co-authors
if ( function_exists( ‘get_coauthors’ ) ) {
$authors = get_coauthors();
}

// Fallback to WP users
if ( empty( $authors ) || ! is_array( $authors ) ) {
$authors = array( get_userdata( get_the_author_meta( ‘ID’ ) ) );
}

foreach ( $authors as $author ) {
$_args = apply_filters(
‘coauthors_posts_link’,
array( ‘href’ => get_author_posts_url( intval( $author->ID ), $author->user_nicename ) )
);

printf(
‘<span class=”byline”><span class=”author vcard”><a class=”url fn n” href=”%1$s” rel=”author”>%2$s</a></span></span>’,
esc_url( $_args[‘href’] ),
esc_html( $author->display_name )
);
}

|}

Gemfile

Support files for Compass

Gemfile.lock

Support files for Compass

header.php

Added link to google fonts for title
[<link href=’http://fonts.googleapis.com/css?family=Crimson+Text:400,600‘ rel=’stylesheet’ type=’text/css’>]

sass

SASS files used to generate the style.css file. Make changes here to update the style.css file. To compile those changes, run “bundle exec compass compile” or “bundle exec compass watch.”

style.css

Child theme styles. This is what makes the child theme work. Includes only those styles that have been modified from the original CSS file.

tag.php

Modified to not display the tag name or description.

Plugins

Akismet

Spam filtering for comments.

Co-Authors Plus

Allows multiple authors to be listed and linked to individual posts. Will be very useful for interview posts.

Display Authors Widget

Used with Widgets on Pages for list of Forum Authors on “Scholars’ Network” Page.

Google Analytics

Adds Google Analytics information to each page.

Members List

Used to display set groups of authors. Also includes search and sorting functionality when authors are displayed on a page.

PressForward

RSS reader and editorial workflow tool.

Recent Posts Widget Extended

Fancy listing of recent posts. Enables sorting by category or tag. Used to display Talks in the Toynbee section.

ScholarPress Researcher

Displays Zotero Library on Recent Scholarship Page.

Simple Page to Sidebar

Used to store officers and trustees in a post and yet display in Toynbee sidebar

Ultimate Category Excluder

Used to block “Resources” posts from front page and from feeds.

Widgets on Pages

Replaces “Add Widgets to Pages”. Used frequently to place widget content on pages. Titles are descriptive of the content they contain.

Woo Sidebars

Used to create and manage custom sidebars for different page types. This is how the different sidebars for the three content areas of the site are created and maintained.

WordPress to Twitter

Tweets Recent Posts.

Widget Areas

Primary Sidebar

Text for mission statement (no title):
“The Toynbee Prize Foundation was chartered to contribute to the development of the social sciences, as defined from a broad historical view of human society and of human and social problems.”
Text for Sponsored Projects:

Title: Sponsored by TPF Body: <a href=”http://newdiplomatichistory.org/“>The Network for New Diplomatic History</a>

<img src=”http://toynbeeprize.org/wp-content/uploads/2014/04/s219465661.jpg” style=”width:25px; margin-right:5px; float:left”><a href=”http://www.degruyter.com/view/j/ngs”> New Global Studies</a>

Text for CHNM:
Title: In Collaboration With: Body: <img src=”http://toynbeeprize.org/wp-content/uploads/2014/04/chnm1.png“> <br> <img src=”http://toynbeeprize.org/wp-content/uploads/2014/04/pressforward1.png“>

Content Sidebar

Includes Quick Links Menu, Browse by Tags, and Recent Comments. Default menu

Custom Sidebars

Set up Sidebars in Appearance -> Widget Areas

Toynbee Sidebar

Includes Toynbee Menu and Simple Page to Sidebar (officers and trustees page)

Sidebar appears on Pages
  • The Toynbee Prize Foundation
  • The Toynbee Prize

Global Initiatives Sidebar

Includes Global Menu and Browse by Tags

Sidebar appears on Pages:
  • Global History Initiatives
  • International Conferences on Global History
  • New Global Studies Journal
  • Perspectives on Global History
  • Recent Scholarship
  • Resources (Draft)
  • Global History Blog (Category)
  • All posts in “Global History Blog”
  • Resources (Category)
  • All posts in “Resources”

Editors at Large Sidebar

Includes Quick Links Menu and Editors at Large Menu

Sidebar appears on Pages:
  • Editors at Large Corner (Draft)
  • Choosing Content: What Should I look for? (Draft)
  • Instructions for Reviewing and Nominating Content (Draft)
  • Sign up to be an Editor-at-Large (Draft)
  • Weekly Schedule (Draft)
  • Participate (Needs to be added once Editors are relaunched)

Forum Sidebar

Includes Forum Menu and Browse by Tags

Sidebar appears on Pages:
  • The Global History Forum
  • Forum (Category)
  • All posts in “Forum”

Widgets to Pages

Set up widget areas in “Settings -> Widgets on Pages”

Global Studies Journal-widgets-on-page

RSS feed for New Global Studies (http://www.degruyter.com/dg/rssalerts/$002fj$002fngs/New$0020Global$0020Studies/toc/NaN)

Authors-widgets-on-page

Display Authors widget for Authors.