Last active
June 18, 2022 10:36
-
-
Save Codevz/030063586cbcf3b258fd7dce27a62954 to your computer and use it in GitHub Desktop.
XTRA WP Theme modify a global option value on individual pages or posts via custom WordPress filter, https://xtratheme.com/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* With this function you can modify an specific option value for specific page or post. | |
* | |
* @var $value saved theme option value | |
* | |
* @return string|array | |
*/ | |
function codevz_custom_logo( $value ) { | |
// Change logo only on home page. | |
if ( is_front_page() ) { | |
$value = 'https://yoursite.com/MY_CUSTOM_LOGO.png'; | |
} | |
return $value; | |
} | |
add_filter( 'codevz/option/logo', 'codevz_custom_logo', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/