Community Forums › Forums › Archived Forums › Design Tips and Tricks › Featured post slider area at top of Decor blog page
- This topic has 7 replies, 2 voices, and was last updated 9 years, 9 months ago by dev.
-
AuthorPosts
-
July 6, 2014 at 3:23 pm #113153RoxGMember
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
http://www.roxineolivia.comJuly 6, 2014 at 5:56 pm #113162devParticipantThere 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.
July 9, 2014 at 3:30 pm #113633RoxGMemberHi Dev,
I tried this and nothing happened. Is there a specific spot I have to add it in?
July 9, 2014 at 3:45 pm #113634devParticipantput 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.
July 9, 2014 at 3:53 pm #113635RoxGMemberI also tried instructions here and got nothing
http://wpsites.net/web-design/add-widget-area-before-content/
July 9, 2014 at 4:00 pm #113636devParticipantAre 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?
July 9, 2014 at 4:31 pm #113639RoxGMemberOk. 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 🙂
July 9, 2014 at 6:06 pm #113662devParticipantYou 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.