Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / related-grid-genesis.css
Created June 29, 2017 14:49
Display Related Posts in Grid Format in Genesis
@topleague
topleague / author-gravatar-post-info.php
Created July 1, 2017 03:30
Author Gravatar in Post Info in Genesis
// Display Author Gravatar in Post Info in Genesis
@link https://wpsites.net/web-design/display-post-author-avatar-byline/
add_action('genesis_entry_header', 'topleague_post_author_avatar');
function topleague_post_author_avatar() {
if (is_single() ) {
echo get_avatar(get_the_author_meta('email'), 40); // change the number to increse/decrease gravatar size
}}
@topleague
topleague / featured-image-caption.php
Last active July 2, 2017 11:30
Display Featured Image with Caption in Genesis
@topleague
topleague / font-awesome-genesis.php
Created July 1, 2017 15:27
Load Font Awesome in Genesis
// Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
}
@topleague
topleague / featured-image-caption.css
Last active July 1, 2017 15:34
Style Featured Image Caption in Genesis
@topleague
topleague / hero-featured-image.php
Created July 6, 2017 14:12
Display Hero Image on Single Posts
@topleague
topleague / design-hero-image-posts.css
Created July 6, 2017 14:20
Design Hero Image on Single Posts
.site-inner {
clear: both;
padding-top: 0;
word-wrap: break-word;
background-color: #fff;
clear: both;
margin-bottom: 100px;
margin-top: 100px;
max-width: 1200px;
position: relative;
@topleague
topleague / author-avatar-above-entry-title.php
Created July 6, 2017 14:34
Display Author Avatar above the Entry Title
// Display Author Avatar above Entry Title
add_action('genesis_before_entry', 'topleague_post_author_avatar');
function topleague_post_author_avatar() {
if (is_single() ) {
echo '<div class="entry-avatar">';
echo get_avatar(get_the_author_meta('email'), 110);
echo '</div>';
}}
@topleague
topleague / post-subtitle-genesis.php
Created July 9, 2017 12:12
Display Excerpt as Post Subtitle in Genesis
//* Display Excerpt as Post Subtitle in Genesis
add_action( 'genesis_entry_header', 'wpsites_excerpt', 10 );
function wpsites_excerpt() {
if ( is_singular( 'post' ) && has_excerpt() ) {
/*if ( is_singular( 'post' && 'page' ) && has_excerpt() ) {*/
printf( '<p class="excerpts">%s</p>', get_the_excerpt() );
}
}
@topleague
topleague / genesis-add-excerpts-pages
Last active July 23, 2017 17:33
Genesis Add Excerpts to Pages
//* Display Page Title and Page Excerpt (as Subtitle) after Header
add_action( 'genesis_header', 'topleague_remove_page_title');
function topleague_remove_page_title () {
if ( is_singular( 'page' ) && !is_front_page() ) { // apply to all pages except the front page
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'topleague_after_header_content' );
function topleague_after_header_content() {
echo '<div class="page-description">';
echo '<h1 itemprop="headline" class="page-title">' . get_the_title() . '</h1>'; // display page title