Podamibe Simple Footer Widget Area Shortcode

Below, you’ll find a detailed guide on how to add the Podamibe Simple Footer Widget Area Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Podamibe Simple Footer Widget Area Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Podamibe Simple Footer Widget Area Plugin and the shortcodes it provides:

✩✩✩✩✩ () Active Installs: + Tested with: PHP Version:
Included Shortcodes:

Podamibe Simple Footer Widget Area [sfwafooter] Shortcode

The Podamibe Simple Footer Widget Area (SFWA) shortcode is designed to dynamically generate and manage footer widget areas in a WordPress site. It retrieves layout and widget settings, determines the number of widget areas, and assigns appropriate CSS classes based on the count. It then loops through these areas, checks if they’re active, and displays their content. If a widget area isn’t active, it prompts the user to add widgets from the admin panel. The shortcode also handles a special footer area for credibility widgets, providing an option to display copyright and powered by information.

Shortcode: [sfwafooter]

Examples and Usage

Basic example – The shortcode ‘sfwafooter’ is utilized to display the footer widget area.

[sfwafooter /]

PHP Function Code

In case you have difficulties debugging what causing issues with [sfwafooter] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'sfwafooter', array($this, 'results') );

Shortcode PHP function:

function results($atts){
$sfwa_widget_setting = get_option('sfwa_widget_setting');
$sfwa_layout_setting = get_option('sfwa_layout_setting');
$count = $sfwa_widget_setting['number_of_widgets_area'];
$widths = array( 'contained', 'fullwidth');
$container = 'sfwa_'.$widths[0];
foreach($widths as $width){
    if($sfwa_layout_setting['full_width_footer']==$width ){
        $container = 'sfwa_'.$width;
    }
}
if($count == 1){
$class_name = 'sfwa_grid_one';
}elseif($count == 2){
    $class_name = 'sfwa_grid_two';
}
elseif($count == 3){
    $class_name = 'sfwa_grid_three';
}
elseif($count == 4){
    $class_name = 'sfwa_grid_four';
}
elseif($count == 5){
    $class_name = 'sfwa_grid_five';
}
elseif($count == 6){
    $class_name = 'sfwa_grid_six';
}
elseif($count == 7){
    $class_name = 'sfwa_grid_7';
}
else{
    $class_name = '';
}

echo '<footer id="sfwa_footer" class="'.$class_name.'">';
echo '<div class="footer-information">';
echo '<div class="'.$container.'">';
echo '<div class="sfwa_row">';
for( $i = 1; $i <= $count; $i++ ){
    if ( is_active_sidebar( 'footer-'. $i ) ){
      echo '<div class="sfwa_footer_area">';
      dynamic_sidebar( 'footer-'. $i );
      echo '</div>';
    }else{
        echo '<div class="sfwa_footer_area">';
        echo '<aside class="widget"><h3 class="widget-title">';
        echo esc_html_e('Widget Area '.$i.'', SFWA_TEXT_DOMAIN);
        echo '</h3>';
        echo esc_html_e('Add some widgets from admin panel', SFWA_TEXT_DOMAIN);;
        echo '</aside>';
        echo '</div>';
  }
}
echo '</div>';
echo '</div>';
echo '</div>';
if ( is_active_sidebar( 'footer-credibility' ) ){
    echo '<div class="footer-creditibility">';
    echo '<div class="'.$container.'">';
    echo '<div class="sfwa_row">';
    echo '<div class="sfwa_footer_area">';
    dynamic_sidebar( 'footer-credibility');
    echo '</div>';
    echo '</div>';
    echo '</div>';
    echo '</div>';
}else{
    if($sfwa_widget_setting['creditibility-footer'] == 'on'){
        echo '<div class="footer-creditibility">';
        echo '<div class="'.$container.'">';
        echo '<div class="sfwa_row">';
        echo '<div class="sfwa_footer_area">';
        echo '<aside class="widget"><h3 class="widget-title">';
        echo esc_html_e('Credential Widget Area', SFWA_TEXT_DOMAIN);
        echo '</h3>';
        echo '<div style="padding:10px 0px;text-align:center;">Copyright 2017 | All Rights Reserved | Powered by ';
        echo '<a href="http://wordpress.org/" target="_blank">';
        echo esc_html_e('Wordpress', SFWA_TEXT_DOMAIN);
        echo '</a> | ';
        echo '<a href="http://podamibenepal.com" target="_blank">';
        echo esc_html_e('Podamibenepal', SFWA_TEXT_DOMAIN);
        echo '</a></div>';
        echo '</aside>';
        echo '</div>';
        echo '</div>';
        echo '</div>';
        echo '</div>';
    }
}
echo '</footer>';
}

Code file location:

podamibe-simple-footer-widget-area/podamibe-simple-footer-widget-area/simple-footer-widget-area.php

Conclusion

Now that you’ve learned how to embed the Podamibe Simple Footer Widget Area Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *