Community Forums › Forums › Archived Forums › Design Tips and Tricks › Slider on Freelance Theme
- This topic has 4 replies, 2 voices, and was last updated 10 years, 5 months ago by Brad Dalton.
-
AuthorPosts
-
November 2, 2013 at 2:33 pm #70554workkyMember
Ok,( is_home or is_homepage, I do not have)
Got a slider showing up on all the pages, I want it to show up on just the home page. I am not using the home page as intended. I'm using a static home page.I have a short code in simple hooks, the only I thing I have in there is " [layerslider id="1"]", I think this is why it shows up on all pages instead on just the home page. I don't know what to write for just home page
included functions php<?php
// Start the engine
include_once( get_template_directory() . '/lib/init.php' );
// Add new image sizes
add_image_size('Homepage', 580, 275, TRUE);
add_image_size('Rectangle', 250, 160, TRUE);
add_image_size('Sidebar', 50, 50, TRUE);
// Add topnav section
add_action('genesis_before_header', 'freelance_include_topnav');
function freelance_include_topnav() {
require(CHILD_DIR.'/topnav.php');
}
// Enable HTML5 markup
add_theme_support( 'html5' );/** Add support for custom header */
add_theme_support( 'custom-header', array(
'width' => 320,
'height' => 110,
'header-selector' => '#header #title-area',
'header-text' => false
) );
// Force layout on homepage
add_filter('genesis_pre_get_option_site_layout', 'freelance_home_layout');
function freelance_home_layout($opt) {
if ( is_home() )
$opt = 'content-sidebar';
return $opt;
}
/** Register widget areas */
genesis_register_sidebar(array(
'name'=>'Home Top',
'id' => 'home-top',
'description' => 'This is the top section of the homepage.',
'before_title'=>'<h4 class="widgettitle">','after_title'=>'</h4>'
));
/** Add support for 3-column footer widgets */
add_theme_support( 'genesis-footer-widgets', 3 );
/** Register widget area */
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => __( 'Home Slider', 'minimum' ),
'description' => __( 'This is the home slider', 'minimum' ),
) );
add_image_size( 'thumbnail', 50, 50, TRUE );
Despite the link, im far from it, just using it as a test bed for a website im trying to convert
life’s tough, it’s a lot tougher if you’re stupid
My WebsiteNovember 2, 2013 at 5:56 pm #70591Brad DaltonParticipantis_front_page()
will work for you.
You will need to find the PHP tag which should be included in the slider docs and add it to a custom function.
November 2, 2013 at 7:06 pm #70614workkyMemberNovember 2, 2013 at 7:44 pm #70620workkyMemberGot it Brad!!!
Thank YOUOnce again you have bailed me out
I ran this in simple hooks
<?php if(is_front_page()):?>
[layerslider id="1"]
<?php endif;?>
life’s tough, it’s a lot tougher if you’re stupid
My WebsiteNovember 2, 2013 at 9:51 pm #70638Brad DaltonParticipant -
AuthorPosts
- The topic ‘Slider on Freelance Theme’ is closed to new replies.