Pages

Showing posts with label Genesis Child Theme Development. Show all posts
Showing posts with label Genesis Child Theme Development. Show all posts

Thursday 11 June 2015

Remove Genesis Header

To remove Genesis header we can simply use "genesis_header" hook to remove "genesis_do_header" function. Use the code in your functions.php or in a specific page template where you want to modify your header. For Example :
/*
 * Remove Genesis Header
========================================*/

remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
if you want to use custom header and want to add header image you can use the following code to hook again to the "genesis_header" and add your custom functions. Place the code in your functions.php
  /*
 * Add custom header Image.
========================================*/

add_action( 'genesis_header', 'aam_genesis_header' );
function aam_genesis_header() {
 /**
  * Get header image
  * @type string
  */
 $am_header_image = get_header_image();
 if ( $am_header_image != '' ) {
    echo '
    <a href="'.get_home_url( '/' ).'">
  <div class="custom-header-wrap">
   <img src="'.$am_header_image.'" title="'.get_bloginfo( 'name' ).'">
  </div>
  </a>';
 } else {
  echo '
  <div class="wrap">
   <div class="title-area">
    <h1 class="site-title" itemprop="headline">
    <a href="'.get_home_url( '/' ).'">'.get_bloginfo( 'name' ).'</a>
    </h1>
   </div>
  </div>';
 }
}

Sunday 14 April 2013

Custom Page Template in Genesis Child Theme - Page Layouts

genesis-page-template-page-layout-child-theme-layouts
Page template is one which are created in WordPress template when you publish a new page there is an option on the left hand side to select the page template. Few page templates are applied by default. for example if you create an home.php it will automatically be applied when Home Page of the site is loaded. similarly single.php is applied when a page is viewed. in this tutorial we will create a Home Page Template for our Genesis Child theme.