Wednesday, 5 August 2015

How to call widgets for footer links in WordPress

How to call widgets on footer to WordPress

NOTE:  create dynamic menu  from "wp-admin/nav-menus.php?" and call on widget

<!---------------functions.php--------------------->

//FOoter
register_sidebar( array(
'name' => 'Footer Sidebar 1',
'id' => 'footer-sidebar-1',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box ftr-logo col-sm-4 ovrimg-mx">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 2',
'id' => 'footer-sidebar-2',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-3">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 3',
'id' => 'footer-sidebar-3',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-3">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );

register_sidebar( array(
'name' => 'Footer Sidebar 4',
'id' => 'footer-sidebar-4',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="ftr-box col-sm-2">',
'after_widget' => '</div>',
'before_title' => '<h4>',
'after_title' => '</h4>',
) );



register_sidebar( array(
'name' => 'bottom 1',
'id' => 'cr-1',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="pull-lft">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );


register_sidebar( array(
'name' => 'bottom 2',
'id' => 'cr-2',
'description' => 'Appears in the footer area',
'before_widget' => '<div class="pull-rgt">',
'after_widget' => '</div>',
'before_title' => '',
'after_title' => '',
) );



<!---------------FOOTER.HTML--------------------->
<footer>
<div class="ftr clrlist listview">
<div class="container">
<?php dynamic_sidebar( 'footer-sidebar-1' ); ?> <!--ftr logo-->
<?php dynamic_sidebar( 'footer-sidebar-2' ); ?> <!--links-->
<?php dynamic_sidebar( 'footer-sidebar-3' ); ?>
    <?php dynamic_sidebar( 'footer-sidebar-4' ); ?> <!--Address-->

        <div class="clearfix"></div>
       
        <div class="cr">

<?php dynamic_sidebar( 'cr-1' ); ?>
<?php dynamic_sidebar( 'cr-2' ); ?>
<!--         <div class="pull-lft">© 2000 – 2015 XYZ.com. All rights reserved.</div>
        <div class="pull-rgt">Designed and Developed by ABC</div>-->
        </div>
       
       
</div>
</div>


<?php  wp_footer(); ?>
</footer>

  </body>
</html>

No comments:

Post a Comment

Alternative content