Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding featured content areas – widgets – to homepage
Tagged: featured content, homepage, streamline, widget
- This topic has 5 replies, 3 voices, and was last updated 9 years, 6 months ago by
geneburwood.
-
AuthorPosts
-
February 4, 2014 at 10:47 am #88551
wizz6113
MemberI am working on Streamline Pro in dev on localhost, so no site link. But basically, I need to replicate the 1st and middle homepage featured content 'widget' areas within the body content area of the home page (I have chosen static home page).
I've successfully registered two new widget areas, and would be dragging Featured Page Advanced into them. However, I can't make the areas visible on the site so guess I need to use CSS to replicate the styling of the original slots, only renaming them. Can anyone suggest code / sequence of workflow to get this done?
Thanks!
http://localdevFebruary 4, 2014 at 11:13 am #88556Brad Dalton
ParticipantUse the same div classes as the ones you replicated but make sure the id.s are different.
genesis_widget_area( 'home-featured-2', array( //the home-featured-2 needs to be unique 'before' => '<div class="home-featured-2 widget-area">', //the home-featured-2 class can be replicated
February 4, 2014 at 2:07 pm #88597wizz6113
MemberBrad,
Thanks for this and it worked fine! No white screen of death! Always nervous of that function php file even in local dev as php is a bit raw for me (learning while doing and trying to do a course on Lynda at the same time).I 've now got two replicated slots in the genesis_entry_content hook area. As they are running one below the other, and not left align and centre, I guess it's a case of replicating the original CSS styling for the original featured slots and adjusting the widget name.
February 4, 2014 at 2:55 pm #88601wizz6113
MemberI am fiddling with the CSS code and am not sure if I use:
a) .home-featured-4 (and .home-featured-5) for the two new widget areas (albeit they are in the genesis_entry_content area. And just slot them into the styling where the .home-featured-1,2,3 are placed so as not to replicate styling in entirety.
b) Or...whether to create a new style area called (guessing here): .genesis . widget-area (and then having some other code to identify the new featured slots.
Am in a bit of a quandary of this. I tried a version of (a) and screwed up the position of the current up top featured slots. So think it's (b) but not sure of the correct code.
If you or another could point me in the right direction, that would great. Tnx.
February 4, 2014 at 3:11 pm #88604wizz6113
MemberThis is the code I now have in the functions.php:
//* Add the page widget in the content - HTML5
add_action( 'genesis_entry_content', 'home_featured_4' );
function home_featured_4() {
if ( is_front_page() )
genesis_widget_area( 'home-featured-4', array(
'before' => '<div class="home-featured-1">',
) );
}//* Add the page widget in the content - HTML5
add_action( 'genesis_entry_content', 'home_featured_5' );
function home_featured_5() {
if ( is_front_page() )
genesis_widget_area( 'home-featured-5', array(
'before' => '<div class="home-featured-2">',
) );
}May 28, 2014 at 1:30 pm #107169geneburwood
ParticipantHey Wizz6113 - How did you make out with this? I am trying to do the exact same thing and having a challenge with the styling.
I have the widgets created in functions.php, just can't get them to show...
TIA
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.