Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / css-svg-genesis.txt
Created May 9, 2018 18:28
CSS for SVG in Gensis
/* STYLING AFTER HERO WIDGET */
.after-hero .wrap {
max-width: 100%;
font-size: 0;
padding-right: 0;
padding-left: 0;
}
/* STYLING BEFORE FOOTER WIDGET */
.before-footer-widget {
@topleague
topleague / widget-areas-svg-path-code
Created May 9, 2018 18:00
Create Widget Areas for SVG Path Code
//* Register an After Hero Widget for Front Page
add_action( 'widgets_init', 'genesischild_front_page_widgets' );
function genesischild_front_page_widgets() {
genesis_register_sidebar( array(
'id' => 'after-hero',
'name' => __( 'After Hero', 'genesischild' ),
'description' => __( 'This is the After Hero area', 'genesischild' ),
) );
}
@topleague
topleague / grid-styles-blog-archives.css
Created April 25, 2018 10:10
Grid Styles in Blog Archives
/* Define Grid Styles in Blog Archives */
.blog .entry, .archive .entry {
background: #fff;
}
.blog .entry-meta, .archive .entry-meta {
margin-bottom: 20px;
font-size: 14px;
font-size: 1.4rem;
@topleague
topleague / relocate-blog-archives.php
Last active December 3, 2019 07:12
Relocating Elements in Gridified Blog Archives in Business Theme
//# Remove and Relocate Featured Image on Blog & Archive Pages
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
// Re-position Category Info on Blog & Archive Pages
add_action('genesis_before_loop','archive_elements_relocation');
function archive_elements_relocation() {
if (is_home() || is_archive() ) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
@topleague
topleague / hero-image-entry-title-subtitle-overlay.php
Created April 25, 2018 08:27
Featured Hero Image with Entry Title and Subtitle as Overlay
//* Display Featured Hero Image with Entry Title and Subtitle as Overlay
add_action( 'genesis_after_header', 'page_hero_image' );
function page_hero_image() {
// if we are not on a single Post, abort.
if ( !is_singular( 'post' && 'page' ) || is_front_page()) {
return;
}
// set $image to URL of featured image. If featured image is not present, set it to post-image.jpg in child theme's images directory.
if ( has_post_thumbnail() ) {
@topleague
topleague / genesis-search-bar-menu.php
Last active December 3, 2019 07:12
Search Bar in Primary Menu in Genesis
//* REMOVE HEADER RIGHT WIDGET AREA AND SHOW PRIMARY NAV MENU WITH SEARCH BOX
//* Credit: Sridhar Katakam
// Step #1: Remove Header Right widget area.
unregister_sidebar( 'header-right' );
// Step #2: Remove Primary Navigation's structural wrap.
add_theme_support( 'genesis-structural-wraps', array( 'header', 'menu-secondary', 'footer-widgets', 'footer' ) );
// Step #3: Rename primary and secondary navigation menus.
@topleague
topleague / full-width-entry-header-posts-pages.php
Created April 2, 2018 06:42
Move Entry Header to a Full-width Hook only on Posts/Pages
// Move Entry Header to a Full-width Hook only on Posts/Pages
add_action( 'genesis_after_header', 'leaguewp_full_width_hook', 9 );
function leaguewp_full_width_hook() {
if ( is_singular('post' ) || is_singular('page' ) ) {
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
@topleague
topleague / mailchimp-rss-email.css
Created November 25, 2017 13:46
MailChimp Code for RSS to Email
*|RSSITEMS:|*
<h2 class="mc-toc-title"><a href="*|RSSITEM:URL|*" target="_blank">*|RSSITEM:TITLE|*</a></h2>
<em>By *|RSSITEM:AUTHOR|* on *|RSSITEM:DATE|*</em><br />
*|RSSITEM:CONTENT|*<br />
<br />
<a href="*|RSSITEM:URL|*" target="_blank">Read in browser &raquo;</a><br />
<br />
*|END:RSSITEMS|*<br />
<br />
<h3 class="h3">Recent Articles:</h3>
@topleague
topleague / htacces-old-domain-new.php
Created November 23, 2017 04:55
Code for .htaccess File (Redirecting an Old Domain to a New Domain)
#Use PHP 5.4
# Use PHP54 as default
AddHandler application/x-httpd-php54 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php54/lib
</IfModule>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301,NC]
@topleague
topleague / featured-image-blog-page-genesis.php
Last active December 3, 2019 07:11
How to Display Featured Image and Overlay Entry Title with Excerpts on Blog Page in Genesis