Skip to content

Instantly share code, notes, and snippets.

.overlay {
background-color: #666;
opacity: .7;
bottom:0;left:0;
height:65px;
position:fixed;
width:100%;
z-index:1000;
}
a.overlay-button {
@StewartChamberlain
StewartChamberlain / overlay.php
Created June 23, 2013 16:24
Purchase Overlay with conditionals
function sc_bottom_overlay() {
if ( in_category ( 'genesis themes' ) ) { // Only display if in category
$button_text = 'Purchase'; // Button Text
$link_uri = 'http://YOUR_LINK_HERE'; // Url for button Link
$overlay = '<div class="overlay"><span style="opacity:1;"><a class="overlay-button" href="'. $link_uri .'">'. $button_text .'</a></span></div>';
echo $overlay;
}
}
add_action( 'genesis_after_footer', 'sc_bottom_overlay' );
<?php
/** DO NOT INCLUDE THE <?php **/
add_action('admin_menu' , 'sc_gsp_extend_cpt_menu');
function sc_gsp_extend_cpt_menu() {
add_submenu_page('edit.php?post_type=portfolio', 'Portfolio Settings', 'Settings', 'edit_posts', basename(__FILE__), 'custom_function');
}
<?php
/** Do NOT include the opening php tag */
/** Offset posts on homepage */
add_action( 'pre_get_posts', 'sc_home_page_post_offset' );
function sc_home_page_post_offset( $query ) {
if ( is_home() )
$query->set ( 'offset', 1);
<?php
/** Do NOT include the opening php tag */
/** Add Rss Icon To Menu */
add_filter( 'genesis_nav_items', 'sc_nav_rss', 10, 2 );
add_filter( 'wp_nav_menu_items', 'sc_nav_rss', 10, 2 );
function sc_nav_rss($menu, $args) {
$args = (array)$args;
<?php
/** Do NOT include the opening php tag */
/** Remove Post Info for Custom Post Types */
function sc_remove_cpt_post_info( $query ) {
if ( is_post_type_archive('CHANGE TO YOUR CPT') ) {
// Remove the post info function
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); // Use this line if using pre Genesis 2.0
<?php
/** Do NOT include the opening php tag */
add_filter( 'genesis_breadcrumb_args', 'sc_breadcrumb_args' );
/**
* Custom Breadcrumbs
*
*/
function sc_breadcrumb_args( $args ) {
<?php
/** Do NOT include the opening php tag */
add_filter( 'genesis_breadcrumb_args', 'sc_breadcrumb_args' );
/**
* Add Clearfix to breadcrumb <div>
*
*/
function sc_breadcrumb_args( $args ) {
<?php
/** Do NOT include the opening php tag */
add_filter ( 'genesis_home_crumb', 'sc_breadcrumb_home_portfolio_link' );
/**
* Modify Home link on portfolio custom post type
*
*/
function sc_breadcrumb_home_portfolio_link( $crumb ) {
<?php // Do Not include this line
// Execute custom home page. If no widgets active, then loop
add_action( 'genesis_meta', 'sc_custom_home_loop' );
function sc_custom_home_loop() {
if ( is_active_sidebar( 'home-featured-full' ) || is_active_sidebar( 'home-featured-left' ) || is_active_sidebar( 'home-featured-right' ) || is_active_sidebar( 'home-middle-1' ) || is_active_sidebar( 'home-middle-2' ) || is_active_sidebar( 'home-middle-3' ) || is_active_sidebar( 'home-bottom' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );