Adding featured content areas – widgets – to homepage

Community Forums Forums Design Tips and Tricks Adding featured content areas – widgets – to homepage

This topic is: not resolved

This topic contains 5 replies, has 3 voices, and was last updated by  geneburwood 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #88551

    wizz6113
    Member
    Post count: 76

    I 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://localdev
    #88556

    braddalton
    Participant
    Post count: 9354

    Use the same div classes as the ones you replicated but make sure the id.s are different.
    [php]

    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
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #88597

    wizz6113
    Member
    Post count: 76

    Brad,
    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.

    #88601

    wizz6113
    Member
    Post count: 76

    I 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.

    #88604

    wizz6113
    Member
    Post count: 76

    This 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″>’,
    ) );
    }

    #107169

    geneburwood
    Participant
    Post count: 1

    Hey 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

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

You must be logged in to reply to this topic.