Skip to content

Instantly share code, notes, and snippets.

@neilgee
neilgee / cpt-nav-single.php
Last active November 12, 2016 06:37
Genesis CPT Navigation Links
<?php //<~ dont add me in
add_action( 'genesis_entry_footer', 'wpb_prev_next_post_nav_cpt' );
function wpb_prev_next_post_nav_cpt() {
if ( ! is_singular( 'portfolio' ) ) //add your CPT name
return;
genesis_markup( array(
'html5' => '<div %s>',
'xhtml' => '<div class="navigation">',
'context' => 'adjacent-entry-pagination',
@neilgee
neilgee / odd-even-postclass.php
Last active May 16, 2017 11:12
Odd/Even Post Class in WordPress
<?php //<~ dont add me in
add_filter( 'post_class', 'themeprefix_odd_even_classes' );
function themeprefix_odd_even_classes( $classes ) {
global $wp_query;
if($wp_query->current_post % 2 == 0) {//http://stackoverflow.com/questions/7959247/php-test-if-number-is-odd-or-even
$classes[] = 'odd';
}
@benweiser
benweiser / Add A Genesis Featured Image Above Post With Title
Last active December 31, 2021 12:15
Add A Genesis Featured Image Above Post With Title - Functions.php
// Hook after header area
add_action( 'genesis_after_header', 'bw_featured_image_title' );
function bw_featured_image_title() {
// If it is a page and has a featured thumbnail, but is not the front page do the following...
if (has_post_thumbnail() && is_single() ) {
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
@nickcernis
nickcernis / mailchimp-popup-for-wordpress.md
Last active July 28, 2022 14:49
MailChimp Popup Script that works with WordPress sites

MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.

Including them in this way isn't always possible or easy with WordPress.

The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.

To use it, modify the baseUrl, uuid, and lid attributes with the ones from the original popup script that MailChimp supplies.

@thierrypigot
thierrypigot / backToTop.css
Created August 21, 2015 10:01
Add back to top in Genesis
/* ## Back to top
--------------------------------------------- */
.eemi-top:hover {
color: #fff !important;
background-color: rgba(0,0,0,0.8);
text-decoration: none;
}
.eemi-top {
display: none;
@nickcernis
nickcernis / style.css
Last active January 20, 2016 02:36
Simple Social Icons font conflict fix
@font-face {
font-family: 'ssi-fontello';
src: url('../font/fontello.eot?78492063');
src: url('../font/fontello.eot?78492063#iefix') format('embedded-opentype'),
url('../font/fontello.woff?78492063') format('woff'),
url('../font/fontello.ttf?78492063') format('truetype'),
url('../font/fontello.svg?78492063#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
@About2git
About2git / gist:79e5e1cd2d90e1539f1e
Created February 14, 2015 16:56 — forked from srikat/gist:7867185
How to set up Sticky Header or Navigation in Genesis
/* Sticky header */
.site-header {
position: fixed;
width: 100%;
z-index: 1000;
}
nav.nav-primary {
padding-top: 164px; /*height of header (can be easily obtained using Firebug)*/
@renventura
renventura / archive-movie.php
Last active June 10, 2016 23:28
Archive template for movie post type
<?php //* Mind this opening PHP tag
/**
* Movie Archive Template
*
* Note that the hooks and genesis_get_image() function used in this file are specific to the Genesis Framework
*
* @author Ren Ventura <EngageWP.com>
* @link http://www.engagewp.com/nested-loops-custom-wordpress-queries
*/
@lmartins
lmartins / genesis_attr_add_class.php
Last active September 20, 2022 13:33 — forked from JiveDig/genesis_attr_add_class.php
Add classes and attributes to any element in Genesis
<?php
//* Add class to .site-container
add_filter('genesis_attr_site-container', 'jive_attributes_st_container');
function jive_attributes_st_container($attributes) {
$attributes['class'] .= ' st-container';
return $attributes;
}
//* Add class to .site-inner
@srikat
srikat / archive-communities.php
Last active March 17, 2016 19:14
How to change Portfolio CPT to Communities in Minimum Pro. http://sridharkatakam.com/change-portfolio-cpt-communities-minimum-pro/
<?php
/**
* The custom communities post type archive template
*/
//* Force full width content layout
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
//* Add even/odd post class
add_filter( 'post_class', 'minimum_even_odd_portfolio_post_class' );