Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kimcoleman/c88c9c0992be33ff22d964a337e3f1d1 to your computer and use it in GitHub Desktop.
Save kimcoleman/c88c9c0992be33ff22d964a337e3f1d1 to your computer and use it in GitHub Desktop.
Memberlite filters to set custom colors for specific pages.
<?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