Want to show slideshow on front page only
-
Hi,
I am using the Delicate theme which has header options to have a slideshow, a featured image or nothing. I want to have the slideshow, but only on the first page “Welcome”
I believe I am using a static page for the Welcome (home) page.
Any tips would be appreciated. I can provide the code from the php.header if needed. I think I need to put in conditional statement, but I am just not sure how to do it and specify just the welcome page.
https://sunsetlodgeresort.com/welcome/
Thanks a lot,
Anna
-
Howdy Anna,
Love the colors on your site / logo!
Zap me the code from your header.php file for that theme.
Either here or to [ redacted, support is offered via the forum and not email ]I can probably help you out.
Take care,
PaulHi Paul,
I’m having the same problem on my site – alonexus.org. When I enter the php code suggested elsewhere on the forum a blank screen appears in place of the site. My header.php code is:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv=”Content-Type” content=”<?php bloginfo(‘html_type’); ?>; charset=<?php bloginfo(‘charset’); ?>” /><title>
<?php if ( is_home()) { bloginfo(‘name’); ?> – <?php bloginfo(‘description’); } ?>
<?php if ( is_search()) { bloginfo(‘name’); ?> – <?php _e(‘Search Results’, ‘nattywp’); } ?>
<?php if ( is_author()) { bloginfo(‘name’); ?> – <?php _e(‘Author Archives’, ‘nattywp’); } ?>
<?php if ( is_single()) { $custom_title = get_post_meta($post->ID, ‘natty_title’, true);
if (strlen($custom_title)) {echo strip_tags(stripslashes($custom_title));}else { wp_title(”); ?> – <?php bloginfo(‘name’); }} ?>
<?php if ( is_page()) { $custom_title = get_post_meta($post->ID, ‘natty_title’, true);
if (strlen($custom_title)) {echo strip_tags(stripslashes($custom_title));}else { bloginfo(‘name’); ?> – <?php wp_title(”); }}?>
<?php if ( is_category()) { bloginfo(‘name’); ?> – <?php _e(‘Archive’,’nattywp’); ?> – <?php single_cat_title(); } ?>
<?php if ( is_month()) { bloginfo(‘name’); ?> – <?php _e(‘Archive’,’nattywp’); ?> – <?php the_time(‘F’); } ?>
<?php if (function_exists(‘is_tag’)) { if ( is_tag() ) { bloginfo(‘name’); ?> – <?php _e(‘Tag Archive’,’nattywp’); ?> – <?php single_tag_title(“”, true); } } ?>
</title><?php /* Include the jQuery framework (see hooks.php) */ ?>
<!– Style sheets –>
<link rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘stylesheet_url’); ?>” media=”screen” />
<?php include (TEMPLATEPATH . ‘/style.php’); ?>
<?php wp_head(); ?><!– Feed link –>
<link rel=”alternate” type=”application/rss+xml” title=”<?php bloginfo(‘name’); ?> RSS Feed” href=”<?php bloginfo(‘rss2_url’); ?>” />
<link rel=”pingback” href=”<?php bloginfo(‘pingback_url’); ?>” /><!– jQuery utilities –>
<?php if (t_get_option(‘t_cufon_replace’) == ‘yes’) { ?>
<!–[if gte IE 9]>
<script type=”text/javascript”>
/*<![CDATA[*/
Cufon.set(‘engine’, ‘canvas’);
/*]]>*/
</script>
<![endif]–>
<script type=”text/javascript”>/*<![CDATA[*/Cufon.replace(‘.post .title h2 a’, {hover:true});/*]]>*/</script>
<?php } ?><!–[if IE 6]>
<?php wp_print_scripts(array(‘ie_menu’)); ?>
<link rel=”stylesheet” type=”text/css” href=”<?php echo get_template_directory_uri(); ?>/ie6.css” />
<style type=”text/css”>
img.png {
filter: expression(
(runtimeStyle.filter == ”) ? runtimeStyle.filter = ‘progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’+src+’, sizingMethod=scale)’ : ”,
width = width,
src = ‘<?php echo get_template_directory_uri(); ?>/images/px.gif’);
}
</style>
<![endif]–><!–[if IE 7]>
<link rel=”stylesheet” type=”text/css” media=”all” href=”<?php echo get_template_directory_uri(); ?>/ie7.css” />
<![endif]–>
<style type=”text/css”>
<?php
$t_show_slideshow = t_get_option( “t_show_slideshow” );
$t_scroll_pages = t_get_option( “t_scroll_pages” );
?>
</style>
</head><body <?php body_class(); ?>>
<div class=”content-pad”><div id=”header”>
<?php t_get_logo (‘<div id=”logo”>’, ‘</div>’, ‘logo.gif’, true); ?><div id=”top_search”>
</div>
<div class=”top”>
<div id=”menu”>
<?php natty_show_navigation (‘primary’, ‘natty_show_pagemenu’); ?>
</div>
</div> <!– END top –><div class=”clear”></div>
<div class=”head-img”>
<?php if ($t_show_slideshow == ‘hide’) {}
elseif (!isset($t_show_slideshow) || $t_show_slideshow == ‘no’) { // Display Slideshow ?>
<div class=”slideshow-bg module”>
<div class=”slideshow”>
<?php if ($t_scroll_pages == ‘no’ || $t_scroll_pages[0] == ‘no’ || $t_scroll_pages[0] == ”){
echo ‘<div><div class=”tagline”>Welcome to Delicate template</div><img src=”‘.get_template_directory_uri().’/images/header/headers.jpg” alt=”Header” /></div>’;
echo ‘<div><div class=”tagline”>Just another WordPress site</div><img src=”‘.get_template_directory_uri().’/images/header/header.jpg” alt=”Header” /></div>’;
} else {
foreach ($t_scroll_pages as $ad_pgs ) {
query_posts(‘page_id=’.$ad_pgs ); while (have_posts()) : the_post(); ?>
<div>
<div class=”tagline”>” title=”<?php the_title(); ?>”><?php the_title(); ?></div>
<?php if ( has_post_thumbnail() ) {the_post_thumbnail(‘slide-thumb’);} // 970×225 ?>
</div>
<?php endwhile; wp_reset_query(); ?>
<?php } //end foreach ?>
<?php } ?>
</div>
<!– END Slideshow –>
<div id=”slideshow-nav”></div>
</div>
<!– END slideshow-bg –>
<?php } else { // Display Header Image
$header_image = get_header_image();
if ( !empty( $header_image ) ) : ?>
<div class=”tagline”><?php bloginfo(‘description’); ?></div>
<img src=”<?php header_image(); ?>” width=”<?php echo HEADER_IMAGE_WIDTH; ?>” height=”<?php echo HEADER_IMAGE_HEIGHT; ?>” alt=”Header” />
<?php endif;
} // End if ?>
</div>
<!– END Header –>Thanks for any help!
Howdy,
First, when pasting code, please use pastebin. It keeps the forum tidy and working nicely. I should have mentioned that.
Second, here’s your solution!
In the theme’s header.php file, find the following line:
elseif (!isset($t_show_slideshow) || $t_show_slideshow == 'no') { // Display Slideshow ?>
Replace it with this line:
elseif ( is_front_page() AND ( !isset($t_show_slideshow) || $t_show_slideshow == 'no') ) { // Display Slideshow ?>
That should fix you up!
Let me know if you need more on this.Take care,
PaulWorked a treat – thanks Paul!
will use paste bin next time
Hi all —
This is my pastebin link: https://pastebin.com/mGU4HqEE
and site: https://sunsetlodgeresort.com/welcome/I believe the line you mentioned that needs to change is 83. Would it be the same for me? I was trying to use it and kept getting errors.
It it would be the same for me (want to have slideshow on welcome page only) than I will continue to try. I will mention that the way I set up my menu bar, to align from the left, my “Welcome” page is actually numbered as “5” instead of “1” in terms of numbering the pages for the menu bar, so maybe do I need to specify that in the conditional formatting rather than “front_page”?
Thanks so much for any info!
Anna
I meant align muy menu on the right, not left — sorry!
Thanks
AnnaHowdy Anna,
1. You’re right, line 83.
2. What error are you getting? Can you pastebin the file after you make the changes so I can see?
3. As long as your Settings > Reading > Front page displays is set to “Static Page” and you select your “Welcome” page from the drop down, you should be golden.Let me see the file after you change around 83. Could be simple typo.
Thx,
PaulHI Paul, it looks like it worked. You can see on the site now that the slideshow is only on the welcome page. https://sunsetlodgeresort.com/welcome/
The code was:
elseif (is_front_page() AND (!isset($t_show_slideshow) || $t_show_slideshow == ‘no’)) { // Display Slideshow ?>
so I think that is exactly what was provided by you. I don’t know what I was doing when I had the error, but i am sure it was user error! I think I had created my own definition of what a front page or static page was and was confusing myself more than I needed to be.
Thanks so much for all of your help!
Anna
Awesome, glad it worked for you.
Take care,
PaulHello Paul,
I updated to wordpree 3.5.1 and my slideshow is not sliding and the buttons don’t show on the homepage on all browsers except IE10. – https://www.mitashah.com
The code on front-page template is
get_header(); ?><?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<div class=”intro”>
<div class=”welcome”>
<h1><?php the_title() ?></h1>
<?php the_content() ?>
</div><div id=”featured”>
<div class=”slideshow”>-
<?php load_featured_content(); ?>
</div>
<div class=”slider-nav”>
<div id=”slidecount”></div>
</div>
</div>
</div>
<?php endwhile; ?>
<div class=”highlights”>
<?php get_sidebar(‘home’); ?>
</div>
<?php get_footer(); ?>Please help.
Many thankaThe conversation is over.
Create your own thread.
- The topic ‘Want to show slideshow on front page only’ is closed to new replies.