Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / manual-excerpts-page-titles-genesis.php
Created Sep 14, 2019
Display Manual Excerpts Below Page Titles
View manual-excerpts-page-titles-genesis.php
//* Add Excerpt support to Pages
add_post_type_support( 'page', 'excerpt' );
//* Output Excerpt on Pages
add_action( 'genesis_meta', 'lwp_page_description_meta' );
function lwp_page_description_meta() {
if ( is_singular() && is_page() && has_excerpt() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'lwp_open_after_header', 5 );
@topleague
topleague / google-fonts-visual-editor-genesis.php
Created Sep 14, 2019
ADD EDITOR STYLE TO YOUR WORDPRESS THEME
View google-fonts-visual-editor-genesis.php
//* ADD EDITOR STYLE TO YOUR WORDPRESS THEME
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
@topleague
topleague / make-website-google-amp-compliant.txt
Created Sep 14, 2019
Customize Standard AMP Pages with Glue for Yoast SEO & AMP Plugin
View make-website-google-amp-compliant.txt
.amp-wp-header {
background-color: #d68231;
}
.amp-wp-header a {
color: #fff;
text-decoration: none;
font-weight: bold;
}
@topleague
topleague / responsive-feature-comparison-tables.txt
Created Sep 14, 2019
Create Responsive Feature Comparison Table in Genesis
View responsive-feature-comparison-tables.txt
<table>
<thead>
<tr>
<td>Features</td>
<th>iPhone 5</th>
<th>iPhone 6</th>
<th>iPhone 7</th>
<th>iPhone 8</th>
</tr>
</thead>
@topleague
topleague / responsive-feature-comparison-tables.txt
Created Sep 14, 2019
Create Responsive Feature Comparison Table in Genesis
View responsive-feature-comparison-tables.txt
<table>
<thead>
<tr>
<th>Features</th>
<th>iPhone 5</th>
<th>iPhone 6</th>
</tr>
</thead>
<tbody>
<tr>
@topleague
topleague / responsive-feature-comparison-tables.txt
Created Sep 14, 2019
HTML and CSS for creating responsive table in Genesis
View responsive-feature-comparison-tables.txt
<table>
<thead>
<tr>
<th>Features</th>
<th>iPhone 5</th>
<th>iPhone 6</th>
</tr>
</thead>
<tbody>
<tr>
@topleague
topleague / categories-primary-menu-genesis.php
Created Sep 14, 2019
display the primary menu conditionally
View categories-primary-menu-genesis.php
//* Remove Primary Nav Menu Conditionally
add_action('template_redirect', 'remove_nav_exclude_blog_page');
function remove_nav_exclude_blog_page() {
if ( !is_archive() && !is_single() && !is_page('blog') )
remove_action('genesis_after_header', 'genesis_do_nav');
}
@topleague
topleague / categories-primary-menu-genesis.txt
Created Sep 14, 2019
Display Categories in Primary Menu Conditionally
View categories-primary-menu-genesis.txt
/*Using Font Awesome Icons in Genesis Navigation (Primary)
------------------------------------------------ */
.nav-primary .genesis-nav-menu .menu-item:before {
display: block;
font-family: 'FontAwesome';
font-size: 55px;
font-style: normal;
font-weight: normal;
line-height: 0;
margin: 0;
View categories-primary-menu-genesis.php
//* Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css', array(), '4.6.3' );
}
@topleague
topleague / show-logo-before-site-title-genesis.php
Created Sep 14, 2019
Show a Logo Before Site Title (via Gravatar)
View show-logo-before-site-title-genesis.php
/*----- Display Logo before Site Title -----*/
add_action( 'genesis_header', 'lwp_site_image', 5 );
function lpw_site_image() {
$header_image = '<img src="https://freeiconshop.com/files/edd/person-girl-flat.png" alt="" />';
printf( '<div class="site-image">%s</div>', $header_image );