Skip to content

Instantly share code, notes, and snippets.

@Codevz
Last active June 18, 2022 10:36
Show Gist options
  • Save Codevz/030063586cbcf3b258fd7dce27a62954 to your computer and use it in GitHub Desktop.
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/
<?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 );
@Codevz
Copy link
Author

Codevz commented Jan 11, 2022

If you want to see more actions and hooks of XTRA WP theme, Please check out documentation here https://xtratheme.com/docs/developer/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment