Skip to content

Instantly share code, notes, and snippets.

@timelsass
Created August 23, 2017 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timelsass/c14be52741fe80b76e81afdff7b661d1 to your computer and use it in GitHub Desktop.
Save timelsass/c14be52741fe80b76e81afdff7b661d1 to your computer and use it in GitHub Desktop.
Venetian add a 3rd column to header template for site description.
/**
* We don't want the site title and tagline to be in the same block for "site branding"
* on this theme.
*
* We will want to override the default site_title/tagline action included,
* and make our own. The default action is added in the header locations of
* the config as '[action]boldgrid_site_identity', so we will put our own
* custom override in as '[action]venetian_site_title'.
*
* This is what the markup is being displayed as currently in venetian:
*
* <div class="site-branding">
* <?php do_action( 'boldgrid_site_title' ); ?>
* <?php do_action( 'boldgrid_print_tagline' ); ?>
* </div><!-- .site-branding -->
*
* Those actions are what output the site title markup and the tagline markup.
* We can use those hooks in our new method, venetian_site_title, so things
* work automatically and we don't have to rewrite any of the logic used.
*/
function venetian_site_title() {
?>
<div class="site-branding">
<?php do_action( 'boldgrid_site_title' ); ?>
</div>
<?php
}
add_action( 'venetian_site_title', 'venetian_site_title' );
/**
* This removes the tagline from the site title location, and we will
* want to add in our own custom tagline area, somewhere in our template.
*/
function venetian_site_tagline() {
?>
<div class="site-tagline">
<?php do_action( 'boldgrid_print_tagline' ); ?>
</div>
<?php
}
add_action( 'venetian_site_tagline', 'venetian_site_tagline' );
/**
* This will add our custom sections to the three col-md-4 bootstrap columns
* layout.
*/
function venetian_custom_header( $configs ) {
// Assign Locations for Generic Header.
$configs['template']['locations']['header'] = array(
'2' => array( '[action]venetian_site_title' ),
'3' => array( '[action]venetian_site_tagline' ),
'4' => array( '[menu]social', '[menu]primary' ),
'5' => array( '[widget]boldgrid-widget-2' ),
'8' => array( '[menu]tertiary' ),
);
return $configs;
}
add_filter( 'boldgrid_theme_framework_config', 'venetian_custom_header' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment