The order of widgets on Modern Portfolio

Community Forums Forums Design Tips and Tricks The order of widgets on Modern Portfolio

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  braddalton 1 year, 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #51104

    rocketgirl
    Participant
    Post count: 34

    Is there a way to have the order of the widgets change. The first placement is portfolio, which i would actually like to have on my page in a lower position. I’m using the “Services” widget as my Slider placement, but want it directly under the menu nav buttons. Thanks very much.

    p.s. i apologize if this is a duplicate post. thought i asked this question last night, but don’t see it. thinking i didn’t do it?!

    http://krobertsphoto.com/kroberts2013/
    #51112

    braddalton
    Participant
    Post count: 10253

    You could simply change the names in the home.php file.

    You might also need to make sure the div id’s match:
    [php]
    genesis_widget_area( ‘portfolio’, array(
    ‘before’ => ‘<div id="portfolio"><div class="wrap">’,
    ‘after’ => ‘</div></div>’,
    ) );
    [/php]


    #51113

    rocketgirl
    Participant
    Post count: 34

    Thank you, so to understand: this is the current order in my home.php file. If i take the first one, portfolio, and replace that word with say, services; services would go to the top?

    Thanks for bearing with me.

    Mary

    function mp_homepage_widgets() {

    genesis_widget_area( ‘portfolio’, array(
    ‘before’ => ‘<div id=”portfolio”><div class=”wrap”>’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘about’, array(
    ‘before’ => ‘<div id=”about”><div class=”wrap”>’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘portfolios’, array(
    ‘before’ => ‘<div id=”portfolio”><div class=”wrap”>’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘blog’, array(
    ‘before’ => ‘<div id=”blog”><div class=”wrap”>’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘services’, array(
    ‘before’ => ‘<div id=”services”><div class=”wrap”>’,
    ‘after’ => ‘</div></div>’,
    ) );

    }

    #51114

    braddalton
    Participant
    Post count: 10253

    Try this
    [php]
    add_action( ‘genesis_meta’, ‘mp_home_genesis_meta’ );
    /**
    * Add widget support for homepage. If no widgets active, display the default loop.
    *
    */
    function mp_home_genesis_meta() {

    if ( is_active_sidebar( ‘services’ ) || is_active_sidebar( ‘portfolio’ ) || is_active_sidebar( ‘about’ ) || is_active_sidebar( ‘blog’ ) ) {

    // Force content-sidebar layout setting
    add_filter( ‘genesis_pre_get_option_site_layout’, ‘__genesis_return_full_width_content’ );

    // Add mp-home body class
    add_filter( ‘body_class’, ‘mp_body_class’ );
    function mp_body_class( $classes ) {
    $classes[] = ‘mp-home’;
    return $classes;
    }

    // Remove the navigation menus
    remove_action( ‘genesis_after_header’, ‘genesis_do_nav’ );
    remove_action( ‘genesis_after_header’, ‘genesis_do_subnav’ );

    // Remove the default Genesis loop
    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );

    // Add homepage widgets
    add_action( ‘genesis_loop’, ‘mp_homepage_widgets’ );

    }

    }

    function mp_homepage_widgets() {

    genesis_widget_area( ‘services’, array(
    ‘before’ => ‘<div id="services"><div class="wrap">’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘portfolio’, array(
    ‘before’ => ‘<div id="portfolio"><div class="wrap">’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘about’, array(
    ‘before’ => ‘<div id="about"><div class="wrap">’,
    ‘after’ => ‘</div></div>’,
    ) );

    genesis_widget_area( ‘blog’, array(
    ‘before’ => ‘<div id="blog"><div class="wrap">’,
    ‘after’ => ‘</div></div>’,
    ) );

    }

    genesis();
    [/php]


    #51118

    rocketgirl
    Participant
    Post count: 34

    when i add – i am unable to preview my page – server error. drats!

    #51128

    braddalton
    Participant
    Post count: 10253

    What did you add?

    The code above is a guide showing you how to simply change the names and id’s of the widgets. These should be changed in your home.php file. Always take a backup of your files before making changes.

    I would download a fresh copy of your theme and upload a new file replacing the file with errors in it.


Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.