• Resolved hensterrsa

    (@hensterrsa)


    Hi

    Please help me I need to write text and add a image before the footer

    I see allot of code but all of them before feature page

    Is it possible to have a widget before footer?

    Kind regards

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try this Snippet

    Thread Starter hensterrsa

    (@hensterrsa)

    hi

    they are all within the footer area

    I need the picture in
    https://choiceofficefurniture.co.za/wp-content/uploads/2015/06/here.png

    but I found this code @ this snipped

    https://presscustomizr.com/snippet/adding-widget-area-home/

    //  Adds 4 widget areas below Featured page section on Home page 
    
    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() {
    dynamic_sidebar('fp_widgets');
    dynamic_sidebar('fp_widgets_two');
    dynamic_sidebar('fp_widgets_three');
    dynamic_sidebar('fp_widgets_four');
    }
    
    // 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';
    }

    so I’m sorted thanks

    Great. Please mark as [resolved] in rh sidebar

    Thread Starter hensterrsa

    (@hensterrsa)

    oops

    sorry

    i already have this wiged active

    add_filter( 'tc_default_widgets' , 'add_featured_page_widget' );
    function add_featured_page_widget( $defaults ) {
     $defaults['fp_widgets'] = array(
                        'name'                 => __( 'Featured Pages Widget' , 'customizr' ),
                        'description'          => __( 'Above the featured pages area on home' , 'customizr' )
     );
        return $defaults;
    }
    
    add_action('__before_fp' , 'display_my_fp_widget');
    function display_my_fp_widget() {
        dynamic_sidebar('fp_widgets');

    so i get a php error if i use both , is there a work around for this?

    Hello,
    function names must be unique in the same namespace. So ..
    change this add_featured_page_widget and this display_my_fp_widget to something different.
    Like:

    add_filter( 'tc_default_widgets' , 'add_featured_page_widget_above' );
    function add_featured_page_widget_above( $defaults ) {
     $defaults['fp_widgets_above'] = array(
                        'name'                 => __( 'Featured Pages Widget' , 'customizr' ),
                        'description'          => __( 'Above the featured pages area on home' , 'customizr' )
     );
        return $defaults;
    }
    
    add_action('__before_fp' , 'display_my_fp_widget_above');
    function display_my_fp_widget_above() {
        dynamic_sidebar('fp_widgets_above');
    }

    Of course also the fp_widgets should have a different name otherwise you display the same widget area twice.

    Thread Starter hensterrsa

    (@hensterrsa)

    Wow

    thanks you guys are the best , if you ever visit us at South Africa I will buy you a beer ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘before footer’ is closed to new replies.