Skip to content

Instantly share code, notes, and snippets.

View mchlshkr's full-sized avatar

mchlshkr mchlshkr

View GitHub Profile
function addUploadMimes($mimes) {
$mimes = array_merge($mimes, array(
'epub|mobi' => 'application/octet-stream'
));
return $mimes;
}
add_filter('upload_mimes', 'addUploadMimes');
// Add Genesis layouts support to CPT
add_post_type_support( 'excerpts', 'genesis-layouts' );
// Force layout on CPT
add_filter('genesis_site_layout', 'ts_CPTNAME_layout');
function ts_CPTNAME_layout($opt) {
if ( is_singular( 'excerpts' ) == get_post_type() )
$opt = 'full-width-content';
return $opt;
}
add_action('get_header','ms_change_genesis_sidebar');
function ms_change_genesis_sidebar() {
if ( is_post_type_archive('reviews')) { // Check if we're on a single post for CPT
remove_action( 'genesis_sidebar', 'ss_do_sidebar' );//remove the default genesis sidebar
add_action( 'genesis_sidebar', 'ms_do_sidebar' ); //add action hook to call function for custom sidebar
}
}
function ms_do_sidebar() {
dynamic_sidebar( 'reviews-page-sidebar' );
function add_excerpts_page_title() {
if ( is_post_type_archive( 'excerpts' ) )
echo '<h1 class="entry-headline" itemprop="headline">Excerpts</h1>';
};
add_action('genesis_before_loop', 'add_excerpts_page_title');
// * Relocate titles on Page, Post and other single pages
add_action( 'genesis_after_header','relocate_entry_title_singular' );
function relocate_entry_title_singular() {
if ( ! is_page('16') )
return;
echo '<div class="entry-header-wrapper"><div class="wrap">';
genesis_do_post_title();
echo '</div></div>';
if ( is_page_template( 'page_blog.php' ) )
return;
function script_managment() {
wp_deregister_script( 'jquery' );
wp_deregister_script( 'jquery-ui' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' );
wp_register_script( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js' );
wp_enqueue_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js', array( 'jquery' ), '4.0', false );
wp_enqueue_script( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js', array( 'jquery' ), '1.8.16' );
}
@mchlshkr
mchlshkr / column-classes.css
Last active August 29, 2015 14:02
Genesis Content Columns
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
@mchlshkr
mchlshkr / box-shadow.css
Last active July 5, 2016 13:14
Box Shadow
/* Box Shadow
--------------------------------------------- */
.yourclass {
-moz-box-shadow: 0 4px 4px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 4px 4px rgba(0,0,0,0.2);
box-shadow: 0 4px 4px rgba(0,0,0,0.2);
}
@mchlshkr
mchlshkr / after-page.css
Last active August 29, 2015 14:00
After Page Widget - CSS
/* After Page
--------------------------------------------- */
.after-page {
background-color: #222;
border-bottom: 1px solid #222;
border-top: 2px solid #222;
margin-top: 30px;
margin-top: 3rem;
padding: 25px 0;