• Hi

    Can someone please help me look through this code: I am trying to add 4 widget area after the feature page to display in a responsive row.

    However, it works fine with my localhost (XAMPP) but break my site when I try it on live.

    Code credit :
    Author : Nicolas & gene coon

    Code Below :

    add_filter( ‘tc_default_widgets’ , ‘add_featured_page_widget’ );
    function add_featured_page_widget( $default_widgets_area ) {
    $default_widgets_area [‘fp_widgets’] = array(
    ‘name’ => __( ‘Featured Pages Widget One’ , ‘customizr’ ),
    ‘description’ => __( ‘Below the featured pages area on home’ , ‘customizr’ )
    );

    $default_widgets_area[‘fp_widgets_two’] = array(
    ‘name’ => __( ‘Featured Pages Widget Two’ , ‘customizr’ ),
    ‘description’ => __( ‘Below the featured pages area on home’ , ‘customizr’ )
    );

    $default_widgets_area[‘fp_widgets_three’] = array(
    ‘name’ => __( ‘Featured Pages Widget Three’ , ‘customizr’ ),
    ‘description’ => __( ‘Below the featured pages area on home’ , ‘customizr’ )
    );

    $default_widgets_area[‘fp_widgets_four’] = array(
    ‘name’ => __( ‘Featured Pages Widget Four’ , ‘customizr’ ),
    ‘description’ => __( ‘Below the featured pages area on home’ , ‘customizr’ )
    );

    return $default_widgets_area;
    }
    add_action(‘__after_fp’ , ‘display_my_fp_widget’);
    function display_my_fp_widget() {
    ?>
    <div class=”row-fluid”>
    <div class=”span3″><?php dynamic_sidebar(‘fp_widgets’); ?></div>
    <div class=”span3″><?php dynamic_sidebar(‘fp_widgets_two’); ?></div>
    <div class=”span3″><?php dynamic_sidebar(‘fp_widgets_three’); ?></div>
    <div class=”span3″><?php dynamic_sidebar(‘fp_widgets_four’); ?></div>
    </div>
    <?php
    }

    // Style all the featured pages widgets so they take up the right space
    add_filter( ‘fp_widgets_class’, ‘display_my_fp_widget_class’);
    add_filter( ‘fp_widgets_two_widget_class’, ‘display_my_fp_widget_class’);
    add_filter( ‘fp_widgets_three_widget_class’, ‘display_my_fp_widget_class’);
    add_filter( ‘fp_widgets_four_widget_class’, ‘display_my_fp_widget_class’);
    function add_featured_page_widget_class() {
    return ‘span3’;
    }

    I will be grateful for any assistance cheers

  • The topic ‘Adding a widget area on home – Code Error’ is closed to new replies.