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 default titles
------------------------------------------------------------ */
add_action( 'get_header', 'child_remove_page_titles' );
function child_remove_page_titles() {
if ( is_page() && ! is_page_template( 'page_blog.php') || $post->post_parent ) {
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
<?php
/* Remove the footer
------------------------------------------------------------ */
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
<?php
/* Unregister primary/secondary navigation menus
------------------------------------------------------------ */
remove_theme_support( 'genesis-menus' );
<?php
/* Add the homepage widgets and projects
------------------------------------------------------------ */
add_action( 'genesis_loop', 'jmd_homepage_widgets' );
function jmd_homepage_widgets() {
genesis_widget_area( 'home-top', array(
'before' => '<div class="home-top"><div class="wrap">',
<?php
/* Add Extra Code to Primary Menu
------------------------------------------------------------ */
function be_menu_extras($menu, $args) {
$extras = '<li class="right">Your extras go here</li>';
return $menu . $extras;
}
add_filter('wp_nav_menu_primary_items','be_menu_extras', 10, 2);
<?php
/* Enqueue google fonts
------------------------------------------------------------ */
add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
function genesis_sample_google_fonts() {
wp_enqueue_style( 'google-font-raleway', '//fonts.googleapis.com/css?family=Raleway:400,700,800,900', array(), CHILD_THEME_VERSION );
wp_enqueue_style( 'google-font-karla', '//fonts.googleapis.com/css?family=Karla:400,700', array(), CHILD_THEME_VERSION );
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:400,700', array(), CHILD_THEME_VERSION );
<?php
/* Add column classes
------------------------------------------------------------ */
add_filter( 'post_class', 'jm_archive_post_class' );
function jm_archive_post_class( $classes ) {
$classes[] = 'one-half';
global $wp_query;
if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 )
<?php
/* Register widget areas
------------------------------------------------------------ */
genesis_register_sidebar( array(
'id' => 'home-welcome',
'name' => __( 'Home Welcome', 'jmd' ),
'description' => __( 'This is the home welcome section.', 'jmd' ),
) );
<?php
/* Site footer
------------------------------------------------------------ */
add_filter('genesis_footer_creds_text', 'jm_footer_creds_text');
function jm_footer_creds_text($creds) {
$creds = '&copy; 2013 &mdash; All Rights Reserved.';
return $creds;
}