Pagelines site logo

[edit] Please Note

These docs are now deprecated, we have a new Support area located here

(Difference between revisions)
(Filter)
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
== Filter ==
 
== Filter ==
<tt>pagelines_site_logo</tt> can be used to override the standard core framework site logo options. This can be used to remove "branding" from sites.
+
<tt>pagelines_site_logo</tt> can be used to override the standard core framework site logo. This can also be used to remove "branding" from sites.
  
 
== Usage ==
 
== Usage ==
Line 20: Line 21:
  
 
/**
 
/**
* If there is no language defined just return the logo html.
+
* If there is no language defined just return the logo HTML.
 
*/
 
*/
 
if ( ! defined( 'ICL_LANGUAGE_CODE' ) )
 
if ( ! defined( 'ICL_LANGUAGE_CODE' ) )
Line 26: Line 27:
 
 
 
/**
 
/**
* Map launguages to images.
+
* Map languages to images.
 
*/
 
*/
 
$images = array(  
 
$images = array(  
 
 
'en' => '../wp-content/themes/earlymusicbesalu/images/logo-eng-2012.png',
+
'en' => '../wp-content/themes/pagelines-child-theme/images/logo-eng-2012.png',
'es' => '../wp-content/themes/earlymusicbesalu/images/logo-es-2012.png',
+
'es' => '../wp-content/themes/pagelines-child-theme/images/logo-es-2012.png',
'ca' => '../wp-content/themes/earlymusicbesalu/images/logo-ca-2012.png',
+
'ca' => '../wp-content/themes/pagelines-child-theme/images/logo-ca-2012.png',
'fr' => '../wp-content/themes/earlymusicbesalu/images/logo-fr-2012.png',
+
'fr' => '../wp-content/themes/pagelines-child-theme/images/logo-fr-2012.png',
 
);
 
);
 
 

Latest revision as of 19:00, 26 March 2012

[edit] Filter

pagelines_site_logo can be used to override the standard core framework site logo. This can also be used to remove "branding" from sites.

[edit] Usage


NB: my_pagelines_site_logo_extension is only meant as an example, a more appropriately named function should be used in actual code.

[edit] Example

If you want to have a different logo based on the language a reader will be viewing the site from then the following will help provide it.

	'../wp-content/themes/pagelines-child-theme/images/logo-eng-2012.png',
		'es'	=>	'../wp-content/themes/pagelines-child-theme/images/logo-es-2012.png',
		'ca'	=>	'../wp-content/themes/pagelines-child-theme/images/logo-ca-2012.png',
		'fr'	=>	'../wp-content/themes/pagelines-child-theme/images/logo-fr-2012.png',		
		);
	
	/**
	 * Select a logo from the image array.
	 */	
	$image = sprintf( 'src="%s', $images[ ICL_LANGUAGE_CODE ] );

	/**
	 * Now we replace the actual logo with our new one.
	 */		
	$logo = preg_replace( '#src="[^"]*#', $image, $logo );
	
	/**
	 * Finally return the adjusted logo.
	 */
	return $logo;
} ?>

[edit] Changelog

Added at version 1.1.0

[edit] Source File

pagelines_site_logo is defined in pagelines_main_logo() which is located in includes/library.templates.php