Community Forums › Forums › Design Tips and Tricks › Remove primary bsidebar in Education
This topic contains 21 replies, has 4 voices, and was last updated by abh 1 month ago.
-
AuthorPosts
-
January 28, 2013 at 9:37 am #15566
Is it possible to remove the primary right widget and only have the secondary widget? They do it in this example: http://demo.studiopress.com/education/
My primary widget shows up even if I don’t put anything in it.
Thanks in advance for help…..
January 28, 2013 at 2:15 pm #15661Bot the primary and secondary sidebars are shown in the demo. If you only want the secondary sidebar you would need to follow this tutorial on switching sidebars then set the home page to content-sidebar layout.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 1:42 pm #16072SoZo, I switched to content sidebar and added this to styles.css but it still is not working. What have I done wrong?
<?php
add_action( ‘genesis_after_header’, ‘be_change_sidebar_order’ );
/**
* Swap Primary and Secondary Sidebars on Sidebar-Sidebar-Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/switch-genesis-sidebars/
*/
function be_change_sidebar_order() {
$site_layout = genesis_site_layout();
if ( ‘content-sidebar’ == $site_layout ) {
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );
// Place the Primary Sidebar into the Secondary Sidebar area.
add_action( ‘genesis_sidebar_alt’, ‘genesis_do_sidebar’ );
}January 29, 2013 at 1:43 pm #16073The style sheet is for CSS style rules. PHP goes in the templates, namely functions.php for this.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 4:13 pm #16153SoZo, I put it in the function.php and I keep getting errors. Here is the one I have now:
Parse error: syntax error, unexpected ‘<’ in /home/w446/public_html/K9/wp-content/themes/education/functions.php on line 98
I went ahead and put in the entire code at this point. Line 98 is the first linen which is the <?php. Should there be 2 curly brackets at the end? What have I done wrong?
Thanks for the help…..
<?php
add_action( ‘genesis_after_header’, ‘be_change_sidebar_order’ );
/**
* Swap Primary and Secondary Sidebars on Sidebar-Sidebar-Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/switch-genesis-sidebars/
*/
function be_change_sidebar_order() {
$site_layout = genesis_site_layout();
if ( ‘sidebar-sidebar-content’ == $site_layout ) {
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );
// Remove the Secondary Sidebar from the Secondary Sidebar area.
remove_action( ‘genesis_sidebar_alt’, ‘genesis_do_sidebar_alt’ );
// Place the Secondary Sidebar into the Primary Sidebar area.
add_action( ‘genesis_sidebar’, ‘genesis_do_sidebar_alt’ );
// Place the Primary Sidebar into the Secondary Sidebar area.
add_action( ‘genesis_sidebar_alt’, ‘genesis_do_sidebar’ );
}
}January 29, 2013 at 4:57 pm #16178You don’t need the PHP opening tag, <?php , since your already in PHP in functions.php
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 6:40 pm #16215SoZo, thanks for the help but this is still not working. This time when I removed the <?php tag then it showed an error at line 114 that said :
Parse error: syntax error, unexpected $end in /home/w446/public_html/K9/wp-content/themes/education/functions.php on line 114 Line 1114 is simply /** Reposition Breadcrumbs */.I have gone in an loaded a fresh function.php to get it back up. But here is the function.php file that created the problem, can you see what the problem is?
Thanks again…….
<?php
/** Start the engine */
require_once( get_template_directory() . ‘/lib/init.php’ );
/** Child theme (do not remove) */
define( ‘CHILD_THEME_NAME’, ‘Education Theme’ );
define( ‘CHILD_THEME_URL’, ‘http://www.studiopress.com/themes/education’ );
/** Create additional color style options */
add_theme_support( ‘genesis-style-selector’, array(
‘education-black’ => __( ‘Black’ , ‘education’ ),
‘education-green’ => __( ‘Green’ , ‘education’ ),
‘education-purple’ => __( ‘Purple’ , ‘education’ ),
‘education-red’ => __( ‘Red’ , ‘education’ ),
‘education-teal’ => __( ‘Teal’ , ‘education’ )
) );
add_action( ‘genesis_meta’, ‘education_add_viewport_meta_tag’ );
/** Add Viewport meta tag for mobile browsers */
function education_add_viewport_meta_tag() {
echo ‘<meta name=”viewport” content=”width=device-width, initial-scale=1.0″/>’;
}
/** Add new image sizes */
add_image_size( ‘featured-image’, 150, 100, TRUE );
/** Add structural wraps */
add_theme_support( ‘genesis-structural-wraps’, array(
‘header’,
‘nav’,
‘subnav’,
‘inner’,
‘footer-widgets’,
‘footer’
) );
/** Add support for custom background */
add_theme_support( ‘custom-background’ );
/** Add support for custom header */
add_theme_support( ‘genesis-custom-header’, array(
‘width’ => 1140,
‘height’ => 120
) );
/** Add support for 3-column footer widgets */
add_theme_support( ‘genesis-footer-widgets’, 3 );
/** Reposition Primary Navigation */
remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
add_action( ‘genesis_before_content_sidebar_wrap’, ‘genesis_do_nav’ );
/** Reposition Secondary Navigation */
remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );
add_action( ‘genesis_before_content_sidebar_wrap’, ‘genesis_do_subnav’ );
/** Reposition Breadcrumbs */
remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );
add_action( ‘genesis_before_content’, ‘genesis_do_breadcrumbs’ );
add_filter( ‘genesis_comment_list_args’, ‘child_comment_list_args’ );
/** Change avatar size */
function child_comment_list_args( $args ) {
$args = array(
‘type’ => ‘comment’,
‘avatar_size’ => 33,
‘callback’ => ‘genesis_comment_callback’
);
return $args;
}
/** Register widget areas */
genesis_register_sidebar( array(
‘id’ => ’slider’,
‘name’ => __( ‘Slider’, ‘education’ ),
‘description’ => __( ‘This is the slider section.’, ‘education’ ),
) );
genesis_register_sidebar( array(
‘id’ => ’intro’,
‘name’ => __( ‘Intro’, ‘education’ ),
‘description’ => __( ‘This is the intro section displayed below the slider.’, ‘education’ ),
) );
genesis_register_sidebar( array(
‘id’ => ’featured’,
‘name’ => __( ‘Featured’, ‘education’ ),
‘description’ => __( ‘This is the featured section displayed below the intro.’, ‘education’ ),
) );
genesis_register_sidebar( array(
‘id’ => ’call-to-action’,
‘name’ => __( ‘Call To Action’, ‘education’ ),
‘description’ => __( ‘This is the call to action banner.’, ‘education’ ),
) );
add_action( ‘genesis_after_header’, ‘be_change_sidebar_order’ );
/**
* Swap Primary and Secondary Sidebars on Sidebar-Sidebar-Content
*
* @author Bill Erickson
* @link http://www.billerickson.net/switch-genesis-sidebars/
*/
function be_change_sidebar_order() {
$site_layout = genesis_site_layout();
if ( ‘sidebar-sidebar-content’ == $site_layout ) {
// Remove the Primary Sidebar from the Primary Sidebar area.
remove_action( ‘genesis_sidebar’, ‘genesis_do_sidebar’ );
// Remove the Secondary Sidebar from the Secondary Sidebar area.
remove_action( ‘genesis_sidebar_alt’, ‘genesis_do_sidebar_alt’ );
// Place the Secondary Sidebar into the Primary Sidebar area.
add_action( ‘genesis_sidebar’, ‘genesis_do_sidebar_alt’ );
// Place the Primary Sidebar into the Secondary Sidebar area.
add_action( ‘genesis_sidebar_alt’, ‘genesis_do_sidebar’ );
}
January 29, 2013 at 6:41 pm #16217If you’re copy/pasting from somewhere make sure that all the quotes are plain quotes and not curly quotes.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
January 29, 2013 at 6:54 pm #16223OK, i redid it all removed the curly brackets } at the very end with ) I still get the error for Parse error: syntax error, unexpected ‘)’ in /home/w446/public_html/K9/wp-content/themes/education/functions.php on line 117 which is again /** Reposition Breadcrumbs */
January 29, 2013 at 8:29 pm #16256bump
January 29, 2013 at 9:45 pm #16293January 29, 2013 at 9:48 pm #16295I’ve tried it with and without the curly brackets and still no luck I keep getting that error message.
February 1, 2013 at 11:29 am #17104Did you find an answer wnb? I’m looking to do the same thing.
February 1, 2013 at 11:42 am #17106avhslibrary, no I didn’t. I tried everything above but could not get past the problems. Please let me know if you find an answer and I’ll do the same.
Thanks
February 1, 2013 at 12:57 pm #17132This is what I want (and I think) what wnb wants as well: http://saintspride.com/admissions/admissions/
A site where the secondary sidebar is there and the primary is not and the content fills the entire page.
-
AuthorPosts
You must be logged in to reply to this topic.