Community Forums › Forums › Archived Forums › General Discussion › Cannot add widgets to News Pro
Tagged: widgets
- This topic has 9 replies, 2 voices, and was last updated 10 years, 4 months ago by tcchronicle.
-
AuthorPosts
-
December 17, 2013 at 5:05 am #79727tcchronicleMember
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.comDecember 17, 2013 at 5:38 am #79733Brad DaltonParticipantDecember 17, 2013 at 5:53 am #79734tcchronicleMemberAdding 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 rawDecember 17, 2013 at 6:22 am #79736tcchronicleMemberI have the widgets now appearing on the website but the styling is not right.
December 17, 2013 at 6:27 am #79737tcchronicleMemberadded 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;
}December 17, 2013 at 6:47 am #79738Brad DaltonParticipantDecember 17, 2013 at 6:51 am #79740tcchronicleMemberif ( 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 -->';
}
December 17, 2013 at 6:57 am #79743Brad DaltonParticipantYou also need to have an action before a function like this which you must have if your widgets are working:
add_action( 'genesis_loop', 'home_sections' ); function home_sections() {
Seems like you only need to tweak the CSS code.
December 17, 2013 at 7:06 am #79747tcchronicleMemberI 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;
}December 17, 2013 at 7:07 am #79748tcchronicleMemberAdded this but the section looks weird
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.