Community Forums › Forums › Archived Forums › Design Tips and Tricks › The order of widgets on Modern Portfolio
- This topic has 5 replies, 2 voices, and was last updated 10 years, 9 months ago by Brad Dalton.
-
AuthorPosts
-
July 17, 2013 at 3:52 am #51104rocketgirlMember
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/July 17, 2013 at 4:48 am #51112Brad DaltonParticipantYou could simply change the names in the home.php file.
You might also need to make sure the div id's match:
genesis_widget_area( 'portfolio', array( 'before' => '<div id="portfolio"><div class="wrap">', 'after' => '</div></div>', ) );
July 17, 2013 at 4:51 am #51113rocketgirlMemberThank 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>',
) );}
July 17, 2013 at 5:01 am #51114Brad DaltonParticipantTry this
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();
July 17, 2013 at 5:12 am #51118rocketgirlMemberwhen i add - i am unable to preview my page - server error. drats!
July 17, 2013 at 7:12 am #51128Brad DaltonParticipantWhat 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.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.