Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / manual-excerpts-page-titles-genesis.php
Created September 14, 2019 17:12
Display Manual Excerpts Below Page Titles
//* 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 September 14, 2019 17:02
ADD EDITOR STYLE TO YOUR WORDPRESS THEME
//* 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 September 14, 2019 16:55
Customize Standard AMP Pages with Glue for Yoast SEO & AMP Plugin
.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 September 14, 2019 14:28
Create Responsive Feature Comparison Table in Genesis
<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 September 14, 2019 14:25
Create Responsive Feature Comparison Table in Genesis
<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 September 14, 2019 14:19
HTML and CSS for creating responsive table in Genesis
<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 September 14, 2019 14:12
display the primary menu conditionally
//* 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 September 14, 2019 14:11
Display Categories in Primary Menu Conditionally
/*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;
@topleague
topleague / categories-primary-menu-genesis.php
Created September 14, 2019 14:08
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', '//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 September 14, 2019 14:00
Show a Logo Before Site Title (via Gravatar)
/*----- 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 );