This section gives a brief description of the changes in the various files contained in the child theme.
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;
}
- 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 );
}
- 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 )
);
}
|}