Support

Account

Home Forums Feature Requests Filter for flexible content layouts Reply To: Filter for flexible content layouts

  • hello,
    see this i got this from github
    Filter: fcb_bg_colors
    Change or add to the available “theme” background colors for blocks

    add_filter( ‘fcb_bg_colors’, ‘custom_bg_colors’);
    function custom_bg_colors($array) {
    $array[‘secondary’] = ‘Secondary’;
    return $array;
    }
    Filter: fcb_btn_colors
    Change or add to the available button colors for block calls to action

    add_filter( ‘fcb_btn_colors’, ‘custom_btn_colors’);
    function custom_btn_colors($array) {
    $array[‘secondary’] = ‘Secondary’;
    return $array;
    }
    Filter: fcb_set_block_htag
    Set the tag that block titles are wrapped in. This defaults to <h2>. First remove the existing filter and then add your own:

    /**
    * Make the first block title an h1 and subsequent blocks default to h2
    */
    remove_filter( ‘fcb_set_block_htag’, ‘block_htag_level’, 10 );
    add_filter( ‘fcb_set_block_htag’, ‘custom_htag_level’, 10, 2 );
    function custom_htag_level($title, $htag) {
    if($GLOBALS[‘fcb_rows_count’] == 0) {
    $htag = ‘h1’;
    } else {
    $htag = ‘h2’;
    }
    return ‘<‘ . $htag . ‘>’ . $title . ‘</’ . $htag . ‘>’;
    }