(→Source File) |
|||
| (3 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 | + | <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 | + | * 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 | + | * Map languages to images. |
*/ | */ | ||
$images = array( | $images = array( | ||
| − | 'en' => '../wp-content/themes/ | + | 'en' => '../wp-content/themes/pagelines-child-theme/images/logo-eng-2012.png', |
| − | 'es' => '../wp-content/themes/ | + | 'es' => '../wp-content/themes/pagelines-child-theme/images/logo-es-2012.png', |
| − | 'ca' => '../wp-content/themes/ | + | 'ca' => '../wp-content/themes/pagelines-child-theme/images/logo-ca-2012.png', |
| − | 'fr' => '../wp-content/themes/ | + | 'fr' => '../wp-content/themes/pagelines-child-theme/images/logo-fr-2012.png', |
); | ); | ||
pagelines_site_logo can be used to override the standard core framework site logo. This can also be used to remove "branding" from sites.
NB: my_pagelines_site_logo_extension is only meant as an example, a more appropriately named function should be used in actual code.
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; } ?>
Added at version 1.1.0
pagelines_site_logo is defined in pagelines_main_logo() which is located in includes/library.templates.php