Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can I Move the Home Page (main URL) like Demo to a different page?
Tagged: Executive theme
- This topic has 9 replies, 2 voices, and was last updated 10 years ago by
SociallyExceptional.
-
AuthorPosts
-
May 21, 2013 at 5:20 pm #42100
SociallyExceptional
ParticipantHello:
We need to add an "entrance" page to our site. This would be on the main url page http://deanamurphyglobal.com/. Then we want to have the next page (http://deanamurphyglobal.com/welcome/) be where we have our slider, then the “home – top”, “home-middle”, “home – call to action”, all the footer widgets, etc as like the demo.
How do we go about doing this?
May 21, 2013 at 6:27 pm #42102Brad Dalton
ParticipantYou can copy the home.php file and rename it.
If you want new widgets for the new template, you'll need to copy the code for the home page and change the i.d's for the widgets in the functions.php file.
May 23, 2013 at 10:11 pm #42407SociallyExceptional
ParticipantOk great! I think I must be missing something still?
I went in and renamed the copy welcome.php and loaded it up and removed the home.php
<?php
add_action( 'genesis_meta', 'executive_welcome_genesis_meta' );
/**
* Add widget support for homepage. If no widgets active, display the default loop.
*
*/
function executive_welcome_genesis_meta() {if ( is_active_sidebar( 'welcome-slider' ) || is_active_sidebar( 'welcome-top' ) || is_active_sidebar( 'welcome-cta' ) || is_active_sidebar( 'welcome-middle' ) ) {
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'executive_welcome_sections' );
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
add_filter( 'body_class', 'executive_body_class' );
add_action( 'genesis_after', 'executive_slider_excerpt_position' );/** Add body class to welcome page **/
function executive_body_class( $classes ) {
$classes[] = 'executive-welcome';
return $classes;
}/** Moves the slider pager if the sidebars are active and the screen is wide enough */
function executive_slider_excerpt_position() {
?>
<script type="text/javascript">
jQuery(document).ready(function() {
if (jQuery(".slide-excerpt").length > 0) {
jQuery(".flex-control-nav").addClass("nav-pos-excerpt");
}
});
</script>
<?php
}
}
}function executive_welcome_sections() {
if ( is_active_sidebar( 'welcome-slider' ) || is_active_sidebar( 'welcome-top' ) || is_active_sidebar( 'welcome-cta' ) || is_active_sidebar( 'welcome-middle' ) ) {
genesis_widget_area( 'welcome-slider', array(
'before' => '<div class="welcome-slider widget-area">',
) );genesis_widget_area( 'welcome-top', array(
'before' => '<div class="welcome-top widget-area">',
) );genesis_widget_area( 'welcome-cta', array(
'before' => '<div class="welcome-cta widget-area">',
) );genesis_widget_area( 'welcome-middle', array(
'before' => '<div class="welcome-middle widget-area">',
) );}
}
genesis();
Then I went into the functions.php file and placed the page id within the widgets code. Currently I don't have the Welcome page showing up with the changes. Thinking I didn't have the proper id within the widgets, I used "welcome" in the id area, but that didn't work either. Here is the code that is currently inside the widgets on the functions.php:
/** Register widget areas **/
genesis_register_sidebar( array(
'id' => '004-slider',
'name' => __( 'Welcome - Slider', 'executive' ),
'description' => __( 'This is the slider section on the home page.', 'executive' ),
) );
genesis_register_sidebar( array(
'id' => '004-top',
'name' => __( 'Welcome - Top', 'executive' ),
'description' => __( 'This is the top section of the home page.', 'executive' ),
) );
genesis_register_sidebar( array(
'id' => '004-cta',
'name' => __( 'Welcome - Call To Action', 'executive' ),
'description' => __( 'This is the call to action section on the home page.', 'executive' ),
) );
genesis_register_sidebar( array(
'id' => '004-middle',
'name' => __( 'Welcome - Middle', 'executive' ),
'description' => __( 'This is the middle section of the home page.', 'executive' ),
) );May 23, 2013 at 11:46 pm #42409Brad Dalton
ParticipantHi
All the apostrophes have been changed now so I cannot test this code.
Please paste the code in Pastebin or Github Gists and link to it here. Thanks
May 26, 2013 at 12:08 pm #42698SociallyExceptional
ParticipantOk, here are the 2 codes again below:
May 26, 2013 at 10:24 pm #42754Brad Dalton
ParticipantThat code looks alright except for the js function for the slider which is the same as the home page and will cause errors so change that.
How about the CSS code? Are you going to use the same classes?
May 28, 2013 at 9:12 pm #43011SociallyExceptional
ParticipantYes, I'd like to use the same classes, just to make it easier. Unless I shouldn't?
May 28, 2013 at 9:16 pm #43012SociallyExceptional
ParticipantOh, I also just realized - I removed the home.php when I renamed and inserted the welcome.php, so technically right now there is no home, or are you referring to a function inside the newly renamed welcome.php
May 30, 2013 at 9:58 am #43219SociallyExceptional
ParticipantWhat specifically needs changed with the js function for the slider? This may be where I was/am confused
May 30, 2013 at 5:12 pm #43270SociallyExceptional
ParticipantGot it! Changed over the JS function so that it wasn't conflicting with the home code and was still able to use the same classes
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.