Created
May 5, 2022 11:49
-
-
Save kimcoleman/c88c9c0992be33ff22d964a337e3f1d1 to your computer and use it in GitHub Desktop.
Memberlite filters to set custom colors for specific pages.
This file contains hidden or 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 | |
/** | |
* Memberlite filters to set custom colors for specific pages. | |
*/ | |
// Filter the primary color on a page with the slug 'free'. | |
function my_memberlite_custom_color_primary( $current_mod ) { | |
if ( ! is_page( 'free' ) ) { | |
return $current_mod; | |
} | |
$current_mod = '#1A688B'; | |
return $current_mod; | |
} | |
add_filter( 'theme_mod_color_primary', 'my_memberlite_custom_color_primary', 5 ); | |
// Filter the secondary color on a page with the slug 'free'. | |
function my_memberlite_custom_color_secondary( $current_mod ) { | |
if ( ! is_page( 'free' ) ) { | |
return $current_mod; | |
} | |
$current_mod = '#658B24'; | |
return $current_mod; | |
} | |
add_filter( 'theme_mod_color_secondary', 'my_memberlite_custom_color_secondary', 5 ); | |
// Filter the action color on a page with the slug 'free'. | |
function my_memberlite_custom_color_action( $current_mod ) { | |
if ( ! is_page( 'free' ) ) { | |
return $current_mod; | |
} | |
$current_mod = '#F89406'; | |
return $current_mod; | |
} | |
add_filter( 'theme_mod_color_action', 'my_memberlite_custom_color_action', 5 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment