Community Forums › Forums › Archived Forums › Design Tips and Tricks › Portfolio added to Outreach Causing Home Page Sidebar
- This topic has 9 replies, 2 voices, and was last updated 10 years, 6 months ago by LeanneT.
-
AuthorPosts
-
October 18, 2013 at 1:02 pm #67398LeanneTMember
I've added a portfolio CPT to Outreach theme which works, but now the Home page is displaying with the sidebar instead of full width:
http://contextinternetpublishing.com/context/
What I did (based on braddalton tutorial on this forum):
http://contextinternetpublishing.com/context/
Registered a portfolio widget in functions.php
Created a page_portfolio.php
Updated Styles.cssOctober 18, 2013 at 1:06 pm #67400nutsandboltsMemberDo you want the sidebar everywhere else but just not on the homepage? Just making sure I understand what you're needing to do.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+October 18, 2013 at 1:56 pm #67414LeanneTMemberYes. Normally, Outreach has a full width home page, no sidebar. It was working fine that way until I added the Portfolio CPT.
Thank you!
October 18, 2013 at 1:59 pm #67416nutsandboltsMemberYou could try changing the default layout in Genesis theme settings to full width. That *should* take care of the homepage.
The only caveat is that you'll need to go back and edit all your pages to make them content/sidebar again (since full width will now be the default), but it only takes a few minutes. Is that an option you might be able to use?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+October 18, 2013 at 2:50 pm #67432LeanneTMemberUnfortunately, that doesn't work. Something in the home.php or somewhere is telling genesis to add the sidebar.
October 18, 2013 at 2:50 pm #67434nutsandboltsMemberOkay, can you paste the contents of your home.php?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+October 22, 2013 at 3:50 pm #68290LeanneTMemberHi! Sorry I dropped off there...
If you're still wiling to take a look, here is my home.php.
Note: I didn't make any changes to home.php. However, I did change functions.php and created page_portfolio.php.
<?php
add_action( 'genesis_meta', 'outreach_home_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function outreach_home_genesis_meta() {if ( is_active_sidebar( 'home-featured' ) || is_active_sidebar( 'home-1' ) || is_active_sidebar( 'home-2' ) || is_active_sidebar( 'home-3' ) || is_active_sidebar( 'home-4' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'outreach_home_featured' );
add_action( 'genesis_before_footer', 'outreach_home_sections', 3 );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
add_filter( 'body_class', 'add_body_class' );function add_body_class( $classes ) {
$classes[] = 'outreach';
return $classes;
}}
}function outreach_home_featured() {
if ( is_active_sidebar( 'home-featured' ) ) {
genesis_widget_area( 'home-featured', array(
'before' => '<div class="home-featured widget-area">'
) );
}}
function outreach_home_sections() {
if ( is_active_sidebar( 'home-1' ) || is_active_sidebar( 'home-2' ) || is_active_sidebar( 'home-3' ) || is_active_sidebar( 'home-4' ) ) {
echo '<div id="home-sections"><div class="wrap">';
genesis_widget_area( 'home-1', array(
'before' => '<div class="home-1 widget-area">',
) );genesis_widget_area( 'home-2', array(
'before' => '<div class="home-2 widget-area">',
) );genesis_widget_area( 'home-3', array(
'before' => '<div class="home-3 widget-area">',
) );genesis_widget_area( 'home-4', array(
'before' => '<div class="home-4 widget-area">',
) );echo '</div><!-- end .wrap --></div><!-- end #home-sections -->';
}
}
genesis();
October 22, 2013 at 3:52 pm #68291nutsandboltsMemberOkay, nothing there forcing the sidebar. In fact, this filter:
add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );
should be forcing full width. How about your functions.php?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+November 1, 2013 at 10:23 am #70314LeanneTMemberHere is the functions.php.
I can't find anything in here that would reset the width on the home page:
<?php
/** Start the engine */
require_once( get_template_directory() . '/lib/init.php' );/** Child theme (do not remove) */
define( 'CHILD_THEME_NAME', 'Outreach Theme' );
define( 'CHILD_THEME_URL', 'http://www.studiopress.com/themes/outreach' );/** Set Localization (do not remove) */
load_child_theme_textdomain( 'outreach', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'outreach' ) );/** Sets Content Width */
$content_width = apply_filters( 'content_width', 650, 450, 960 );/** Load Google fonts */
add_action( 'wp_enqueue_scripts', 'outreach_load_google_fonts' );
function outreach_load_google_fonts() {
wp_enqueue_style(
'google-fonts',
'http://fonts.googleapis.com/css?family=Lato',
array(),
PARENT_THEME_VERSION
);
}/** Add Viewport meta tag for mobile browsers */
add_action( 'genesis_meta', 'outreach_add_viewport_meta_tag' );
function outreach_add_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}/** Add new image sizes */
add_image_size( 'featured', 1040, 400, TRUE );
add_image_size( 'home-sections', 215, 140, TRUE );
add_image_size( 'sidebar', 300, 150, TRUE );
add_image_size( 'portfolio-outreach', 328, 200, TRUE );/** Create additional color style options */
add_theme_support( 'genesis-style-selector', array(
'outreach-blue' => __( 'Blue', 'outreach' ),
'outreach-orange' => __( 'Orange', 'outreach' ),
'outreach-red' => __( 'Red', 'outreach' )
) );/** Add support for custom background */
add_custom_background();/** Add support for custom header */
add_theme_support( 'genesis-custom-header', array(
'width' => 1060,
'height' => 120
) );/** Add support for structural wraps */
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
) );/** Reposition the secondary navigation */
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_before_content_sidebar_wrap', 'genesis_do_subnav' );/** Modify the size of the Gravatar in the author box */
add_filter( 'genesis_author_box_gravatar_size', 'outreach_author_box_gravatar_size' );
function outreach_author_box_gravatar_size( $size ) {
return '80';
}/** Add the sub footer section */
add_action( 'genesis_before_footer', 'outreach_sub_footer', 5 );
function outreach_sub_footer() {
if ( is_active_sidebar( 'sub-footer-left' ) || is_active_sidebar( 'sub-footer-right' ) ) {
echo '<div id="sub-footer"><div class="wrap">';genesis_widget_area( 'sub-footer-left', array(
'before' => '<div class="sub-footer-left">'
) );genesis_widget_area( 'sub-footer-right', array(
'before' => '<div class="sub-footer-right">'
) );echo '</div><!-- end .wrap --></div><!-- end #sub-footer -->';
}
}/** Add support for 4-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 4 );/** Customizes go to top text */
add_filter( 'genesis_footer_backtotop_text', 'footer_backtotop_filter' );
function footer_backtotop_filter($backtotop) {
return '[footer_backtotop text="' . __('Top' , 'outreach' ) . '"]';
}/** Register widget areas */
genesis_register_sidebar( array(
'id' => 'home-featured',
'name' => __( 'Home Featured', 'outreach' ),
'description' => __( 'This is the home featured section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'home-1',
'name' => __( 'Home #1', 'outreach' ),
'description' => __( 'This is the home #1 section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'home-2',
'name' => __( 'Home #2', 'outreach' ),
'description' => __( 'This is the home #3 section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'home-3',
'name' => __( 'Home #3', 'outreach' ),
'description' => __( 'This is the home #4 section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'home-4',
'name' => __( 'Home #4', 'outreach' ),
'description' => __( 'This is the home #4 section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'sub-footer-left',
'name' => __( 'Sub Footer Left', 'outreach' ),
'description' => __( 'This is the sub footer left section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'sub-footer-right',
'name' => __( 'Sub Footer Right', 'outreach' ),
'description' => __( 'This is the sub footer right section.', 'outreach' )
) );
genesis_register_sidebar( array(
'id' => 'portfolio',
'name' => __( 'Portfolio', 'outreach' ),
'description' => __( 'This is the portfolio page.', 'outreach' ),
) );November 1, 2013 at 10:27 am #70315LeanneTMemberWooot!!!
Okay I just figured it out finally! There was a plugin I forgot I had, Layout Extras, and somehow the setting for the homepage got reset to content-sidebar.
Thanks!
Leanne
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.