Created
June 15, 2016 19:32
-
-
Save jaygidwitz/066998f3b5cc85b69186f587179abe4c to your computer and use it in GitHub Desktop.
for raise you vibraitons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Custom widgets above category pages for pinterest style blog. | |
/** Register widget areas */ | |
genesis_register_sidebar( array( | |
'id' => 'cta-1', | |
'name' => __( 'Call to Action #1', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-2', | |
'name' => __( 'Call to Action #2', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-3', | |
'name' => __( 'Call to Action #3', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-4', | |
'name' => __( 'Call to Action #4', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-5', | |
'name' => __( 'Call to Action #5', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-6', | |
'name' => __( 'Call to Action #6', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'cta-7', | |
'name' => __( 'Call to Action #7', 'mp' ), | |
'description' => __( 'This is the call to action section.', 'mp' ), | |
) ); | |
add_action( 'genesis_after_header', 'mp_cta_genesis' ); | |
/** | |
* Add CTA widget support for site. If widget not active, don't display | |
* | |
*/ | |
function mp_cta_genesis() { | |
// Don't display the CTA on the home page, since it's built into the MP theme | |
if ( is_home() ) { | |
return; | |
} | |
// If it's the Read page, display CTA #1 | |
elseif ( is_category( 'Read' ) ) { | |
genesis_widget_area( 'cta-1', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Create page, display CTA #1 | |
elseif ( is_category( 'Move' ) ) { | |
genesis_widget_area( 'cta-2', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Go/Do page, display CTA #3 | |
elseif ( is_category( 'Create' ) ) { | |
genesis_widget_area( 'cta-3', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Listen page, display CTA #3 | |
elseif ( is_category( 'Go/Do' ) ) { | |
genesis_widget_area( 'cta-4', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Sing page, display CTA #3 | |
elseif ( is_category( 'Express' ) ) { | |
genesis_widget_area( 'cta-5', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Meditate page, display CTA #3 | |
elseif ( is_category( 'Meditate' ) ) { | |
genesis_widget_area( 'cta-6', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If it's the Move page, display CTA #3 | |
elseif ( is_category( 'Listen' ) ) { | |
genesis_widget_area( 'cta-7', array( | |
'before' => '<div id="cta"><div class="wrap">', | |
'after' => '</div></div>', | |
) ); | |
} | |
// If all else fails and none of the above conditions are met, display CTA #4 | |
else { | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment