Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / prev-next-post-genesis-image.php
Last active December 3, 2019 07:10
Previous/Next Post in Genesis (Featured Image)
// ADD NEXT/PREV POST + Add Featured Images To Previous & Next Post Nav Links
add_action('genesis_after_entry', 'wpsites_image_nav_links', 9 );
/**
* @author Brad Dalton
* @link http://wpsites.net/web-design/add-featured-images-to-previous-next-post-nav-links/
* //https://crunchify.com/how-to-display-last-updated-on-datetime-of-your-wordpress-blog-post-genesis-framework-hook-included/
//https://stackoverflow.com/questions/7563568/display-post-date-on-previous-next-link
// https://sridharkatakam.com/add-links-previous-post-next-post-single-posts-genesis/
*/
function wpsites_image_nav_links() {
@topleague
topleague / overlay-entry-title-meta.php
Created August 24, 2019 14:20
Overlay Entry Title/Post Info/Meta on Featured Image on Single Post
// Register a custom image size for hero images on single Posts
add_image_size( 'post-image', 1600, 400, true );
add_action( 'genesis_before_entry', 'sk_hero_image' );
function sk_hero_image() {
// if we are not on a single Post, abort.
if ( !is_singular( 'post' ) ) {
return;
}
@topleague
topleague / relocate-post-info-meta.php
Created August 24, 2019 14:15
Relocate Post Info and Post Meta (Category Label and Date Stamp)
// RELOCATING POST META (CATEGORY LABLE) FROM FOOTER TO ENTRY HEADER AREA
// Relocate Post Meta
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
// Filter Post Meta and Use it Condtionally
add_filter( 'genesis_post_meta', 'leaguewp_post_meta_filter' );
function leaguewp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before=""] [post_tags before=""]';
return $post_meta;
@topleague
topleague / relocate-entry-widget.php
Created August 24, 2019 14:13
Move Genesis After Entry Widget to Inside Post Entry
// Move Genesis After Entry Widget to Inside Post Entry
// https://amethystwebsitedesign.com/move-genesis-after-entry-widget-to-inside-post-entry/
// Add support for after entry widget
add_theme_support( 'genesis-after-entry-widget-area' );
// Remove the after entry widget from after blog post entry
remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' );
// Add the after entry widget at the end of the post content
add_action( 'genesis_after_entry', 'genesis_after_entry_widget_area', 9 );
@topleague
topleague / prev-next-post-genesis.php
Created August 24, 2019 14:12
Previous/Next Post in Genesis
// ADD NEXT/PREV POST
// https://sridharkatakam.com/add-links-previous-post-next-post-single-posts-genesis/
add_action( 'genesis_after_entry', 'custom_adjacent_entry_nav', 9 );
function custom_adjacent_entry_nav() {
if ( !is_singular( 'post' ) ) {
return;
}
@topleague
topleague / remove-menu-label-parallax-pro.php
Created August 17, 2019 06:35
Remove "MENU" Label from Genesis Parallax Pro Responsive Menu
// Define our responsive menu settings.
function parallax_responsive_menu_settings() {
$settings = array(
'mainMenu' => __( '', 'parallax-pro' ),
'subMenu' => __( '', 'parallax-pro' ),
'menuClasses' => array(
'combine' => array(
'.nav-header',
'.nav-primary',
@topleague
topleague / remove-word-menu-word-genesis-3.php
Created August 17, 2019 02:32
Remove Word “MENU” in Genesis 3.0
return array(
'script' => array(
'mainMenu' => __( '', 'genesis-sample' ),
'menuClasses' => array(
'others' => array( '.nav-primary' ),
),
),
'extras' => array(
'media_query_width' => '960px',
),
@topleague
topleague / redesign-related-post-genesis.txt
Created August 17, 2019 01:29
Redesign Related Posts in WordPress (CSS)
/*------------- Change Font Size of Related Post Title -------------*/
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-size: 16px!important;
font-weight: bold!important;
font-family: sans-serif;
}
/*------------- Change Fonts of Related Posts Headline -------------*/
#jp-relatedposts h3.jp-relatedposts-headline em {
font-weight: 900;
@topleague
topleague / redesign-related-post-genesis.php
Last active August 17, 2019 01:21
Redesign Related Posts in WordPress
//* Remove in and quotes around category names (in Jetpack Related Posts)
add_filter( 'jetpack_relatedposts_post_category_context', 'lwp_customize_jp_context', 10, 2 );
function lwp_customize_jp_context( $post_cat_context, $category ) {
$post_cat_context = sprintf(
// _x( 'In "%s"', 'in {category/tag name}', 'jetpack' ), /* Default */
_x( '%s', 'in {category/tag name}', 'jetpack' ),
$category->name
);
return $post_cat_context;
@topleague
topleague / post-meta-post-info.css
Created February 13, 2019 07:01
Post Meta and Post Info CSS
/* --- Post Meta Styling ---*/
.entry-categories, .entry-tags {
display: inline-block;
border: 1px solid;
padding: 0 10px;
background: #1982df;
color: white;
box-shadow: 1px 1px #fff;
text-transform: uppercase;
font-weight: bold;