Skip to content

Instantly share code, notes, and snippets.

@mhulse
Created February 25, 2012 00:05
Show Gist options
  • Save mhulse/1904753 to your computer and use it in GitHub Desktop.
Save mhulse/1904753 to your computer and use it in GitHub Desktop.
Pagelines 2.1.1, Base Theme 1.0.2 and Wordpress 3.3.1: PageLines section a header with blog name/title and logo...
<?php
/*
Section: Brand & Flag
Author: Micky Hulse
Author URI: http://www.registerguard.com
Description: Shows full width branding and flag.
Class Name: BrandAndFlag
Workswith: header
*/
class BrandAndFlag extends PageLinesSection {
function __construct($registered_settings = array()) {
$default_settings = array(
'type' => 'header',
'workswith' => array('header'),
);
$settings = wp_parse_args($registered_settings, $default_settings);
parent::__construct($settings);
}
function section_template() {
echo $this->brand_text();
echo $this->brand_image();
}
function brand_text() {
return sprintf( '<h6><a class="home site-title" href="%s">%s</a></h6><p class="site-description subhead">%s</p>', esc_url(home_url()), get_bloginfo('name'), get_bloginfo('description'));
}
function brand_image() {
global $pagelines_ID;
$oset = array('post_id' => $pagelines_ID);
$return = '';
if (ploption('pagelines_custom_logo', $oset) || apply_filters('pagelines_site_logo', '') || apply_filters('pagelines_logo_url', '')) {
$logo_url = apply_filters('pagelines_logo_url', esc_url(ploption('pagelines_custom_logo', $oset)), $this->id);
$site_logo = sprintf( '<a class="mainlogo-link" href="%s"><img class="mainlogo-img" src="%s" alt="%s" /></a>', home_url(), $logo_url, get_bloginfo('name'));
$return = apply_filters('pagelines_site_logo', $site_logo, $this->id);
}
return $return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment