Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / css-grid-responsive-grid.css
Last active December 3, 2019 07:11
CSS Grid for Responsive Grid Layout in Genesis
/* CSS Grid for Responsive Grid Layout | Credit: Sridhar Katakam */
.content-archive .content {
float: none;
}
.articles {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
@topleague
topleague / css-grid-featured-cpt-genesis.css
Last active December 3, 2019 07:11
CSS Grid for Featured CPT for Genesis Plugin
@topleague
topleague / css-grid-archive-template-genesis.php
Created September 6, 2017 12:45
Custom Template for CSS Grid in Genesis
<?php
add_filter( 'body_class', 'custom_body_class' );
/**
* Add `content-archive` class to the body element.
*
* @param array $classes the current body classes
* @return array $classes modified classes
*/
function custom_body_class( $classes ) {
@topleague
topleague / load-genesis-grid-template.php
Created September 7, 2017 14:59
Load Genesis Grid Template
<?php
get_template_part( 'loop', 'archive' );
genesis();
@topleague
topleague / featured-services-css-grid.css
Last active September 10, 2017 04:15
Display Featured Services using CSS Grid in Genesis
@topleague
topleague / create-display-custom-widget.php
Created September 10, 2017 04:29
Create and Display Custom Widgets
// ADD THE FOLLOWING CODE TO YOU FUNCTIONS.PHP FILE
// Register a new widget area
genesis_register_sidebar( array(
'id' => 'your-widget-name',
'name' => __( 'Your Widget Name', 'genesis' ),
'description' => __( 'This is your widget section.', 'genesis' ),
) );
// ADD THE FOLLOWING CODE TO YOU FRONT-PAGE.PHP OR ANY OTHRE CUSTOM TEMPLATE FILE
@topleague
topleague / magazine-grid-template-genesis.php
Last active September 10, 2017 18:12
Magazine Grid Template File in Genesis (Front Page)
//* Create a front-page.php file and poaste the following code
<?php
//* Force content-sidebar layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
add_action( 'genesis_meta', 'magazine_home_genesis_meta' );
@topleague
topleague / widgets-magazine-grid-template.php
Created September 10, 2017 18:15
Register New Widgets for Magazine Grid Template
//* Add the following code to your functions.php in Genesis Starter Theme
// Register Featured Top widget areas
genesis_register_widget_area(
array(
'id' => "featured-top",
'name' => __( "Featued Top", 'my-theme-text-domain' ),
'description' => __( "This is the Featued Top section.", 'my-theme-text-domain' ),
)
);
@topleague
topleague / magazine-grid-genesis.css
Created September 10, 2017 18:18
CSS for Magazine Grid in Genesis Sample
/* Add the following code to your styles.css file or any other custom css file */
/* HOME PAGE GRID */
.magazine {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
}
.magazine .featured-content .entry {
clear: both;
@topleague
topleague / hook-entry-title-meta-info-entry-content.php
Created September 14, 2017 02:25
Hook Entry Title, Post Info, Post Meta to Entry Content // Featured Image to Entry Header
// Add the following code to your functions.php
// Hook Featured Image to Entry Header
add_action( 'genesis_entry_header', 'featured_post_image', 5 );
function featured_post_image() {
if ( !is_singular( array( 'post', 'page' ) )) return;
the_post_thumbnail('post-image');
}
//* Remove the entry title in the entry header