Cannot add widgets to News Pro

Community Forums Forums General Discussion Cannot add widgets to News Pro

This topic is: not resolved

Tagged: 

This topic contains 9 replies, has 2 voices, and was last updated by  tcchronicle 10 months, 1 week ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #79727

    tcchronicle
    Participant
    Post count: 9

    Everytime I try to add widgets (I want middle left and right) and I add the functions.php and the style css it breaks my site and it goes blank.

    My site is http://www.tcchronicle.com

    http://www.tcchronicle.com
    #79733

    braddalton
    Participant
    Post count: 10243
    #79734

    tcchronicle
    Participant
    Post count: 9

    Adding this to functions.php
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-left2′,
    ‘name’ => __( ‘Home – Middle Left’2, ‘news’ ),
    ‘description’ => __( ‘This is the middle left section of the homepage.’, ‘news’ ),
    ) );
    genesis_register_sidebar( array(
    ‘id’ => ‘home-middle-right2′,
    ‘name’ => __( ‘Home – Middle Right2′, ‘news’ ),
    ‘description’ => __( ‘This is the middle right section of the homepage.’, ‘news’ ),
    ) );

    and added this to the stylesheet
    /* Page Widget
    ———————————————————— */

    #pagewidget {
    line-height: 1.5;
    padding: 32px;
    padding: 3.2rem;
    }

    #pagewidget p {
    margin-bottom: 24px;
    margin-bottom: 2.4rem;
    text-align: center;
    }
    view raw

    #79736

    tcchronicle
    Participant
    Post count: 9

    I have the widgets now appearing on the website but the styling is not right.

    #79737

    tcchronicle
    Participant
    Post count: 9

    added this to the stylesheet but not doing anything
    /* Home Middle 2
    ———————————————————— */

    #home-middle-2 {
    border-bottom: 1px solid #d5d5d5;
    overflow: hidden;
    }

    #home-middle-2 .border {
    border-bottom: 4px solid #eee;
    overflow: hidden;
    }

    #home-middle-2 .wrap {
    overflow: hidden;
    padding: 25px 25px 15px;
    }

    .home-middle-left-2 {
    float: left;
    width: 290px;
    }

    .home-middle-right-2 {
    float: right;
    width: 285px;
    }

    #79738

    braddalton
    Participant
    Post count: 10243

    And how about the PHP for the home page template?


    #79740

    tcchronicle
    Participant
    Post count: 9

    if ( is_active_sidebar( ‘home-middle-left-2′ ) || is_active_sidebar( ‘home-middle-right-2′ ) ) {

    echo ‘<div id=”home-middle-2″><div class=”border wrap”>’;

    echo ‘<div class=”home-middle-left-2″>’;
    dynamic_sidebar( ‘home-middle-left-2′ );
    echo ‘</div><!– end .home-middle-left-2 –>’;

    echo ‘<div class=”home-middle-right-2″>’;
    dynamic_sidebar( ‘home-middle-right-2′ );
    echo ‘</div><!– end .home-middle-right-2 –>’;

    echo ‘</div><!– end .border wrap –></div><!– end #home-middle-2 –>’;

    }

    #79743

    braddalton
    Participant
    Post count: 10243

    You also need to have an action before a function like this which you must have if your widgets are working:
    [php]
    add_action( ‘genesis_loop’, ‘home_sections’ );
    function home_sections() {
    [/php]

    Seems like you only need to tweak the CSS code.


    #79747

    tcchronicle
    Participant
    Post count: 9

    I have that at the beginning. Not sure about the css. Is this the right CSS to add at the bottom then?

    /* Home Top
    ———————————————————— */

    #home-top {
    border-bottom: 1px solid #d5d5d5;
    overflow: hidden;
    }

    #home-top .border {
    border-bottom: 4px solid #eee;
    overflow: hidden;
    }

    #home-top .wrap {
    overflow: hidden;
    padding: 20px 25px 15px;
    }

    #home-top .ui-tabs ul.ui-tabs-nav {
    border-bottom: 1px dotted #ddd;
    margin: 10px 0;
    padding: 0 0 13px;
    }

    #home-top .ui-tabs ul.ui-tabs-nav li a {
    background-color: #f5f5f5;
    font-weight: bold;
    }

    #home-top .ui-tabs ul.ui-tabs-nav li a:hover,
    #home-top .ui-tabs ul.ui-tabs-nav li.ui-tabs-selected a {
    background-color: #00a7ed;
    color: #fff;
    }

    #home-top .ui-tabs .post {
    background-color: #fff;
    margin: 0;
    padding: 0;
    }

    /* Home Middle
    ———————————————————— */

    #home-middle {
    border-bottom: 1px solid #d5d5d5;
    overflow: hidden;
    }

    #home-middle .border {
    border-bottom: 4px solid #eee;
    overflow: hidden;
    }

    #home-middle .wrap {
    overflow: hidden;
    padding: 25px 25px 15px;
    }

    .home-middle-left {
    float: left;
    width: 290px;
    }

    .home-middle-right {
    float: right;
    width: 285px;
    }

    .home-middle-left-2 {
    float: left;
    width: 290px;
    }

    .home-middle-right-2 {
    float: right;
    width: 285px;
    }

    /* Home Bottom
    ———————————————————— */

    #home-bottom {
    overflow: hidden;
    }

    #home-bottom .wrap {
    overflow: hidden;
    padding: 20px 25px 15px;
    }

    #79748

    tcchronicle
    Participant
    Post count: 9

    Added this but the section looks weird

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.