Featured post slider area at top of Decor blog page

Community Forums Forums Design Tips and Tricks Featured post slider area at top of Decor blog page

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  dev 4 months, 3 weeks ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #113153

    RoxG
    Participant
    Post count: 29

    OK, I’m having a real challenging time doing what I thought would be simple.

    On my blog page only, I want an area at the top where I can have a slider that’s linked to my featured posts, like Genesis Responsive Slider and if possible to have some welcome text. I tried using widgets on pages and inserted it into a sticky post but 1) the slider had bullet point before and after it and the images were totally off 2) this left the post info and categories at the bottom.

    Can anyone suggest a way to do this?

    Thanks in advance for any suggestions

    • This topic was modified 4 months, 3 weeks ago by  RoxG.
    • This topic was modified 4 months, 3 weeks ago by  RoxG.
    http://www.roxineolivia.com
    #113162

    dev
    Participant
    Post count: 468

    There is probably a better way than this (which I’m sure someone will post here).

    I use this code. Change the “is_page” from “333” to whatever the ID of your blog page is. If you don’t know how to find the ID of your page, search for it here… it’s easy.

    This will give you a widget area which will let you use the slider widget of your choice.

    // For sticky blog... put this at end of theme's functions.php flle
    
    genesis_register_sidebar( array(
        'id'        => 'text-before-blog',
        'name'      => 'Text Before Blog',
        'description'   => 'This is the widget for displaying text before blog posts.',
    ) );
     
    add_action('genesis_before_content', 'apparition_text_before_blog' );
    function apparition_text_before_blog() {
     
        if( is_page(333) ) {
            echo '<div class="text-before-blog">';
                dynamic_sidebar( 'text-before-blog' );
            echo '</div>';
        }
    }
    

    Hope this helps. Like I say there is probably a plugin or better code to create a ‘sticky’ widget area on the blog page. I’ve never used it for a slider, but only for a text box… like the “Change is Constant” blurb on our site.

    Hope this works for you.

    Dev

    http://www.NewMediaWebsiteDesign.com

    #113633

    RoxG
    Participant
    Post count: 29

    Hi Dev,

    I tried this and nothing happened. Is there a specific spot I have to add it in?

    #113634

    dev
    Participant
    Post count: 468

    put the code in at at the end of the functions.php file using the built-in WP editor (under Appearances). After you save it, go to the Widgets page and you should see a new widget area. Remember to change the ID to that of YOUR blog page.

    #113635

    RoxG
    Participant
    Post count: 29

    I also tried instructions here and got nothing

    http://wpsites.net/web-design/add-widget-area-before-content/

    #113636

    dev
    Participant
    Post count: 468

    Are you at least seeing the widget area on the widget page?

    The code should work. You are putting it in the functions.php file, right?

    #113639

    RoxG
    Participant
    Post count: 29

    Ok. Admittedly no the sharpest pencil in the bunch, lol. It’s there! I just didn’t realize I had to go over to the widgets section to add the content. Thanks so much for your help :)

    #113662

    dev
    Participant
    Post count: 468

    You are welcome. There is probably a cleaner / better way to do this… probably some plugin out there, but our shop hasn’t found it yet! I think we ‘stole’ the code from Brad’s site (he has a huge reference of library of code snippets) … not sure.

    You may have to add some CSS margin or padding code to get the widget placed where you want but it should be close without it.

    Dev

    http://www.NewMediaWebsiteDesign.com

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

You must be logged in to reply to this topic.