Skip to content

Instantly share code, notes, and snippets.

Brad Dalton braddalton

View GitHub Profile
View functions.php
add_action( 'genesis_entry_content', 'recipe_anchor_point', 5 );
function recipe_anchor_point() {
if ( is_singular( 'post' ) ) {
printf( '<p><a href="%s" class="anchor">' . __( 'JUMP TO RECIPE' ) . '</a></p>', __( '#recipe' ) );
}
@braddalton
braddalton / functions.php
Last active Apr 15, 2019
Essence Pro Add Background Image To Footer CTA Widget https://wp.me/p1lTu0-hP5
View functions.php
'before' => '<div id="footer-cta" class="footer-cta" class="widget-area"><div class="wrap">',
@braddalton
braddalton / functions.php
Created Apr 15, 2019
Add Background Image To Footer CTA Widget Essence Pro https://wp.me/p1lTu0-hP5
View functions.php
'before' => '<div id="footer-cta" class="footer-cta"><div class="wrap"><div class="widget-area">',
View credits-1.php
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the credits
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
function sp_footer_creds_text() {
echo '<div class="creds"><p>';
echo 'Copyright &copy; ';
echo date('Y');
echo ' &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
@braddalton
braddalton / functions.php
Created Feb 8, 2019
Foodie Pro Default Search Menu Code
View functions.php
add_filter( 'wp_nav_menu_items', 'foodie_pro_primary_nav_menu_search', 12, 2 );
function foodie_pro_primary_nav_menu_search( $menu, $args ) {
if ( 'primary' !== $args->theme_location || genesis_get_option( 'nav_extras' ) ) {
return $menu;
}
$menu .= sprintf( '<li id="foodie-search" class="foodie-search menu-item">%s</li>',
genesis_search_form( false )
);
@braddalton
braddalton / functions.php
Created Feb 8, 2019
Foodie Pro - Reposition Search Box Before Nav Menu https://wp.me/p1lTu0-iiR
View functions.php
add_filter( 'wp_nav_menu_items', 'foodie_pro_search_primary_nav_menu', 12, 2 );
function foodie_pro_search_primary_nav_menu( $menu, $args ) {
if ( 'primary' !== $args->theme_location || genesis_get_option( 'nav_extras' ) ) {
return $menu;
}
$search = sprintf( '<li id="foodie-search" class="foodie-search menu-item">%s</li>',
genesis_search_form( false )
);
@braddalton
braddalton / functions.php
Last active Jan 30, 2019
Add Shortlink on Genesis Tag Archives https://wp.me/p1lTu0-ie6
View functions.php
add_action( 'genesis_entry_footer', 'add_wp_get_shortlink' );
function add_wp_get_shortlink() {
if ( is_tag() ) {
printf( '<a href="%s">' . __( 'Your link text here' ) . '</a>', wp_get_shortlink() );
}
}
@braddalton
braddalton / functions.php
Last active Jan 30, 2019
Add Shortlink Anywhere In Genesis https://wp.me/p1lTu0-ie6
View functions.php
add_action( 'genesis_entry_footer', 'add_wp_get_shortlink' );
function add_wp_get_shortlink() {
printf( '<a href="%s">' . __( 'Your link text here' ) . '</a>', wp_get_shortlink() );
}
View functions.php
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
$post_info = 'by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
View text.html
<h1 class="hero-title" style="font-size:8vw;">Hello World</h1>
<p class="hero-text" style="font-size:2vw;">Resize the browser window to see how the font size scales.</p>
You can’t perform that action at this time.