Skip to content

Instantly share code, notes, and snippets.

<?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');
}
@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' );
.overlay {
background-color: #666;
opacity: .7;
bottom:0;left:0;
height:65px;
position:fixed;
width:100%;
z-index:1000;
}
a.overlay-button {
<?php
function sc_bottom_overlay() {
$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
add_action( 'genesis_before_content', 'sc_tag_message' );
function sc_tag_message() {
if ( is_tag() ) {
$current_tag = single_tag_title("", false);
$message = '<div class="tag-message">';
$message .= '<h3> Please click on the blog on '. $current_tag .' below</h3>';
$message .= '</div>';
echo $message;
@StewartChamberlain
StewartChamberlain / jquery-google-cdn.php
Created May 28, 2013 15:26
Wordpress Enqueue Jquery From Google CDN
<?php
// Enqueue jQuery from Google CDN. Uses the currently registered WordPress jQuery version.
function google_jquery_enqueue() {
// Probably not necessary if called with the 'wp_enqueue_scripts' action.
if (is_admin()) return;
global $wp_scripts;
// Change this flag to have the CDN script triggered by wp_footer instead of wp_head.
$cdn_script_in_footer = false;
<?php
/** Do NOT include the opening php tag */
/** Add post navigation (requires HTML5 support) */
add_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 );
<?php
// Turn On HTML5 Markup
add_theme_support( 'html5' );
@StewartChamberlain
StewartChamberlain / 3d.css
Last active December 17, 2015 08:08
Css text-shadow Tutorial
h1.three-d {
color: rgb(255, 255, 255);
text-shadow: 0px 1px 0px rgba(153, 153, 153, 0.6),
0px 2px 0px rgba(136, 136, 136, 0.6),
0px 3px 0px rgba(119, 119, 119, 0.6),
0px 4px 0px rgba(102, 102, 102, 0.6),
0px 5px 0px rgba(85, 85, 85, 0.6),
0px 6px 0px rgba(68, 68, 68, 0.7),
0px 7px 0px rgba(51, 51, 51, 0.8),
0px 8px 7px rgba(0, 17, 53, 0.9);
<?php
/**
* HTML5 Secondary Sidebar
* @author Stewart Chamberlain
* @link http://stewartchamberlain.com/tutorials/convert-genesis-child-theme-to-html5/
*/
?>
<aside id="sidebar-alt" class="sidebar widget-area">
<?php
genesis_structural_wrap( 'sidebar-alt' );