• Resolved sophie7

    (@sophie7)


    Hello,
    I would like to know if there is a way to use page colors (defined in Theme Options > Page Color) in the page itself (for example for the title of the page…)

    Thank you

    Sophie

Viewing 1 replies (of 1 total)
  • Theme Author Richie KS

    (@rkcorp)

    add this to child functions.php or wp-content/meso-custom-functions.php

    /*-----------------------------------------------------
    Description: Add new pages color block for main nav
    -----------------------------------------------------*/
    function meso_child_page_style_init() {
    global $wp_pages;
    print '<style id="child-page-css" type="text/css" media="all">' . "\n";
    $page_color_cache = '';
    if( is_array($wp_pages) ) {
    foreach ($wp_pages as $page_value) {
    $page_id = $page_value;
    $page_value_option = 'tn_page_color_' . $page_id;
    $page_color_option = get_theme_mod('page_color_'.$page_id);
    $page_color_cache .= '#custom article.post-single.post-' . $page_id . ' h1.post-title {color: '. $page_color_option .';}';
    }
    }
    echo $page_color_cache;
    print '</style>' . "\n";
    }
    add_action('wp_head','meso_child_page_style_init',10);
Viewing 1 replies (of 1 total)
  • The topic ‘Using page colors in mesocolumn theme’ is closed to new replies.