Adding extra widgets

Discussion in 'ClassiCraft WordPress Theme' started by jbissitt, Feb 3, 2015.

  1. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    Hi guys

    I would like to add a text area at the footer of the home page under the advert listings, I assume this could be achieved with a new widget area. How can I add a new widget in this area?

    Many thanks

    Joel
     

    Attached Files:

  2. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello Joel!

    To achieve this you have to add codes in two file functions.php and index.php


    Add this code in functions.php at last
    PHP:
    <?php
    function wpb_widgets_init() {
     
        
    register_sidebar( array(
            
    'name' => __'Home Page Below Sidebar''wpb' ),
            
    'id' => 'sidebar-1',
            
    'description' => __'The main sidebar appears on the right on each page except the front page template''wpb' ),
            
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
            
    'after_widget' => '</aside>',
            
    'before_title' => '<h3 class="widget-title">',
            
    'after_title' => '</h3>',
        ) );
        }
    add_action'widgets_init''wpb_widgets_init' );
    ?>
    Add this code in index.php file to show widget area on home page.
    PHP:
    <?php if ( is_active_sidebar'sidebar-1' ) ) : ?>
        <div id="home-widget-home" class="widget-area" role="complementary">
        <?php dynamic_sidebar'sidebar-1' ); ?>
        </div>
    <?php endif; ?>
    Thanks
    Pramod
    inkthemes.com
     
  3. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    Thanks Pramod, very grateful. I would like to run a body of text the width of the adverts, would I do this by just adding a text widget or do I have to format the width as well?
     
  4. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello !

    I am not confirmed about it.
    You can add it we will help you to manage it later by css.

    Thanks
    Pramod
     
  5. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    Hi Pramod. I added the above code for the functions.php via the editor and the website crashed. Can you please check the code is correct and advise exactly where I need to add these? Thanks Joel
     
  6. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello Joel!

    If your website has crashed and you are unable to do more editing from dashboard then you have to change the functions.php through FTP.
    If you have localhost too then please check all these with localhost first.


    Thanks
    Pramod
     
  7. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    Hi, yes I changed the file back and all OK, can you please check the code and advise as I would really like to add this extra widget area. Thanks Joel
     
  8. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello Joel!

    You can test given code in localhost .
    If it works , you can use it in your live site.

    Thanks & Regards
    Pramod
     
  9. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    Thanks Pramod but what do you mean test in localhost?
     
  10. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello !

    I mean to say test it first in your computer.
    I will check this and reply you soon .

    Thanks & Regards
    Pramod
     
  11. jbissitt

    jbissitt Member

    Joined:
    Jan 13, 2015
    Messages:
    65
    Likes Received:
    0
    OK, thanks Pramod
     
  12. Pramod

    Pramod Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,847
    Likes Received:
    63
    Hello Joel!

    I have checked and it works fine please follow above instructions and below link..
    http://screenpresso.com/=pg40e


    Thanks & Regards
    Pramod
     

Share This Page