Community Forums › Forums › Archived Forums › Design Tips and Tricks › Anyone added a custom home widget on Streamline?
Tagged: register widget area, streamline theme
- This topic has 2 replies, 2 voices, and was last updated 11 years, 10 months ago by casm.
-
AuthorPosts
-
January 14, 2013 at 8:33 am #11822casmMember
I am looking for help to customise the streamline theme with a home-bottom widget area so I can place a page below the three featured page widget areas at the top.
I have experimented with registering the widget area as per the instructions in the code snippets section but when I save the functions.php I get this message (HAVE REMOVED URL):
"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /nfs/c10/h03/mnt/150349/domains/REMOVEDURLFORSECURITYREASONS/html/wp-content/themes/streamline/functions.php on line 151"
This happened to me the last time I attempted to register a widget area but everything I've read suggests that it is supposed to be easy.
My client is annoyed because she only wants one post/page showing up next to the sidebar on her website and without being able to add this widget area, I can't fix the problem.
Can anyone help?
Cheers,
Cas
January 14, 2013 at 9:23 am #11835David DeckerMemberThis should work in general.
However, the error you get is for a missing or wrong syntax in your custom code. Could please post the actual code snippet you added here - or via http://pastebin.com service, and where you added in functions.php, at the top, at the very bottom or otherwise.Thanks, Dave 🙂
January 15, 2013 at 1:13 am #12017casmMemberThanks for responding Dave.
I have fixed the functions.php with the help of Studiopress Support and have added code to the home.php and now the widget is working but won't show up on the home page.
Here's the code I used on the home.php
<?php
add_action( 'genesis_meta', 'streamline_home_genesis_meta' );
/**
* Add widget support for homepage.
*
*/
function streamline_home_genesis_meta() {if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) {
add_action( 'genesis_before_content_sidebar_wrap', 'streamline_home_loop_helper' );
}
}
/**
* Display widget content for home featured sections.
*
*/
function streamline_home_loop_helper() {if ( is_active_sidebar( 'home-featured-1' ) || is_active_sidebar( 'home-featured-2' ) || is_active_sidebar( 'home-featured-3' ) ) {
echo '<div id="home-featured">';
echo '<div class="home-featured-1">';
dynamic_sidebar( 'home-featured-1' );
echo '</div><!-- end .home-featured-1 -->';echo '<div class="home-featured-2">';
dynamic_sidebar( 'home-featured-2' );
echo '</div><!-- end .home-featured-2 -->';echo '<div class="home-featured-3">';
dynamic_sidebar( 'home-featured-3' );
echo '</div><!-- end .home-featured-3 -->';echo '</div><!-- end #home-featured -->';
}
}
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'custom_widget' );
function custom_widget() {
genesis_widget_area( 'home-bottom', array( 'before' => '<div
id="home-bottom" class="home-bottom widget-area">' ) );
}genesis();
And here's the CSS I used (I feel like I'm feeling my way in the dark here... just copied this from another blog that has done this).
/* Home Bottom Widget Area
------------------------------------------------------------ */
.home-bottom .post-info{
overflow: hidden;
margin-right; 5px;
padding: 0 0 25px;
width: 100%;
}What I want is for the home-bottom widget area to show instead of the blog posts.
If you can help me figure out how to do that, I would really appreciate it.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.