Skip to content

Instantly share code, notes, and snippets.

View freezvd's full-sized avatar

Valentin Zmaranda freezvd

  • Bucharest, Romania
View GitHub Profile
<?php
/* Remove the entry image
------------------------------------------------------------ */
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
<?php
/* Remove the entry content
------------------------------------------------------------ */
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
<?php
/* Remove the post info
------------------------------------------------------------ */
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
<?php
/* Add span class to widget headline
------------------------------------------------------------ */
add_filter( 'widget_title', 'child_widget_title' );
function child_widget_title( $title ){
if( $title )
return sprintf('<span>%s</span>', $title );
}
<?php
/* Load scripts before closing the body tag
------------------------------------------------------------ */
add_action('genesis_after_footer', 'child_script_managment');
function child_script_managment() {
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' );
wp_register_script( 'jquery-ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js' );
wp_enqueue_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', array( 'jquery' ), '4.0', false );
<?php
/* Remove scripts loading from header
------------------------------------------------------------ */
add_action('wp_enqueue_scripts', 'child_deregister_scripts');
function child_deregister_scripts() {
wp_deregister_script( 'jquery' );
wp_deregister_script( 'jquery-ui' );
}
<?php
/* Slides Post Type
------------------------------------------------------------ */
add_action('init','jm_create_slides_init');
function jm_create_slides_init() {
$labels = array
(
'name' => _x('Slides', 'post type general name', 'jm'),
<?php
/* Add slider
------------------------------------------------------------ */
add_action('genesis_after_header', 'jm_home_slider');
function jm_home_slider() {
echo '<div id="featured-slider">';
<?php
/* Unregister sidebars
------------------------------------------------------------ */
unregister_sidebar( 'header-right' );
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );
<?php
/* Add page titles
------------------------------------------------------------ */
add_action('genesis_after_header', 'jm_page_title');
function jm_page_title() {
if (!is_home()) {
echo '<div class="page-title"><div class="wrap">';