StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 10-13-2012, 05:34 PM
NandoJourneyman NandoJourneyman is offline
Registered User
Pro Plus Member
 
Join Date: Apr 2012
Location: ATX
Posts: 14
Question Adding Widget Area to a Single Page

I keep messing this up, so I figured I'd ask.

Here's what I'm trying to do: I want to have a page that shows the page content, as the page template normally would. Right after the content, there will be a widget area. While I imagine just about any widget could be used here, I intend to use the Genesis Responsive slider to show and scroll through several subpages' worth of content without having to navigate to them.

Ideally, this will be a full width page (no sidebars).

I can't seem to get a custom template to work for this.

Help? Pretty please?
  #2  
Old 10-13-2012, 06:06 PM
andrea_r's Avatar
andrea_r andrea_r is offline
Forum Manager
 
Join Date: Nov 2009
Location: Eastern Canada
Posts: 36,279
Default

Related to your other post - this is the part where you;d use the eleven40 widget tute to add the widget area with a hook. ;)

Or... if you made a new page template, add the widget area right in the template. Can also use a hook here.


http://www.studiopress.com/tutorials/hooks
http://www.studiopress.com/tutorials/hook-reference
http://genesistutorials.com/visual-hook-guide
__________________
*****
These forums were CLOSED to new posts on November 19th, 2012. New forums are here: http://www.studiopress.com/forums/ and you will need to SIGN UP AGAIN.

If you need assitance with setting up your theme, go to http://my.studiopress.com/ and read the SETUP links or the TUTORIALS link on the side tab.

If you need Account Assistance, file a help desk ticket at the same location.
  #3  
Old 10-15-2012, 09:22 AM
NandoJourneyman NandoJourneyman is offline
Registered User
Pro Plus Member
 
Join Date: Apr 2012
Location: ATX
Posts: 14
Default Eureka!

I got it. Well, it works, but I figured I post the code here for someone else's benefit, as well as your vetting for whatever code compliances and compatibilities I may have missed

Here's the template (I called mine page_widgetized.php):

Code:
<?php
/*
Template Name: Widgetized Page
*/

/** Optional -Forces the full width layout on the Portfolio page */
/** add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); */

/** Optional -Removes the standard loop */
/** remove_action( 'genesis_loop', 'genesis_do_loop' ); */

/** This adds the widgetized area */
add_action( 'genesis_after_post_content', 'widgetized_page_area_sidebar' );

/** This should put a widget area right after the content*/
function widgetized_page_area_sidebar() {
    echo '<div class="widgetized-area-style">';
            dynamic_sidebar( 'widgetized-page-area' );
    echo '</div>';
}

genesis();

Of course, this need to be registered in functions.php :

Code:
/** Register Widgetized Page Area widget */
genesis_register_sidebar( array(
    'id'        => 'widgetized-page-area',
    'name'      => 'Widgetized Page Area',
    'description'   => 'This is the widgetized page area sidebar.',
) );

It's been assigned a class, so that the CSS is (with whatever width value works for user):

Code:
/* Widgetized Area style
--------------------------------- */
.widgetized-area-style {
    clear: both;
    margin: 0 auto;
    width: 728px;
}
Not too bad huh?
  #4  
Old 10-15-2012, 09:23 AM
andrea_r's Avatar
andrea_r andrea_r is offline
Forum Manager
 
Join Date: Nov 2009
Location: Eastern Canada
Posts: 36,279
Default

Pretty snazzy - move to the head of the class. ;)
__________________
*****
These forums were CLOSED to new posts on November 19th, 2012. New forums are here: http://www.studiopress.com/forums/ and you will need to SIGN UP AGAIN.

If you need assitance with setting up your theme, go to http://my.studiopress.com/ and read the SETUP links or the TUTORIALS link on the side tab.

If you need Account Assistance, file a help desk ticket at the same location.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:49 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.