Remove primary bsidebar in Education

Community Forums Forums Design Tips and Tricks Remove primary bsidebar in Education

This topic is: not resolved

This topic contains 21 replies, has 4 voices, and was last updated by  abh 1 year, 5 months ago.

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #15566

    wnb
    Participant
    Post count: 30

    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…..

    #15661

    SoZo
    Moderator
    Post count: 1573

    Bot 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

    #16072

    wnb
    Participant
    Post count: 30

    SoZo, 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’ );
    }

     

    #16073

    SoZo
    Moderator
    Post count: 1573

    The 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

    #16153

    wnb
    Participant
    Post count: 30

    SoZo, 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’ );
    }
    }

    #16178

    SoZo
    Moderator
    Post count: 1573

    You 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

    #16215

    wnb
    Participant
    Post count: 30

    SoZo, 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’ );

    }

     

    #16217

    SoZo
    Moderator
    Post count: 1573

    If 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

    #16223

    wnb
    Participant
    Post count: 30

    OK, 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 */

    #16256

    wnb
    Participant
    Post count: 30

    bump

    #16293

    SoZo
    Moderator
    Post count: 1573

    You need the curly brackets


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #16295

    wnb
    Participant
    Post count: 30

    I’ve tried it with and without the curly brackets and still no luck I keep getting that error message.

    #17104

    avhslibrary
    Participant
    Post count: 18

    Did you find an answer wnb? I’m looking to do the same thing.

    #17106

    wnb
    Participant
    Post count: 30

    avhslibrary, 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

     

    #17132

    avhslibrary
    Participant
    Post count: 18

    This 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.

     

     

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.