Skip to content

Instantly share code, notes, and snippets.

@robincornett

robincornett/functions.php Secret

Last active Mar 15, 2017
Embed
What would you like to do?
SuperSide Me functions to add a second Sidr panel. still under development and may change at any time.
<?php
add_filter( 'supersideme_second_panel', 'prefix_add_second_panel' );
/**
* SuperSide Me filter to pass necessary values to the script.
* Everything else (colors, timing, etc.) will follow the plugin settings.
* @return array
*/
function prefix_add_second_panel() {
return array(
'button' => '#new-button', // must be an ID
'source' => '#new-widget', // must be an ID
'panel' => 'widget-panel', // will be the ID of the new panel
'side' => 'left',
);
}
add_action( 'genesis_before_header', 'prefix_add_button' );
/**
* Add a button element to the DOM. ID must match the button key in the second panel filter.
*/
function prefix_add_button() {
echo '<div class="buttons-menu"><button id="new-button" aria-pressed="false" aria-expanded="false">New Button</button></div>';
}
add_action( 'genesis_after', 'prefix_add_widget' );
/**
* Source for the new panel. Again, the ID must match. Instead of doing this by hand,
* you can use an existing widget or div element which would be added to the site and hidden by default.
*/
function prefix_add_widget() {
echo '<div id="new-widget" style="display:none;"><p>Thanks a lot, kid. Please, Marty, don\'t tell me, no man should know too much about their own destiny. I\'ll call you tonight. What\'s going on? Where have you been all week? I hope so.</p>';
echo '<p>What Lorraine, what? Hello. I\'m gonna ram him. I have to tell you about the future. Mayor Goldie Wilson, I like the sound of that.</p>';
echo '<p>Calvin, why do you keep calling me Calvin? I don\'t worry. this is all wrong. I don\'t know what it is but when I kiss you, it\'s like kissing my brother. I guess that doesn\'t make any sense, does it? Well, they\'re bigger than me. Wait a minute. Wait a minute, Doc. Are you telling me that it\'s 8:25? Hot, Jesus Christ, Doc. Jesus Christ, Doc, you disintegrated Einstein.</p></div>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment