Main Index Only Displays JScript Slideshow When Posts Exists or Are Displayed.. Help!

My question is exactly as the title states. I’m using a Wordpress theme that has a nice, pre-installed Java Script slide show. However, the slideshow will only display IF you have posts… I would prefer the main index to be a designated landing page, not recent posts… Actually I would prefer it to just be the slide show and nothing else!

Here’s the code from index.php that calls the slide show when their are posts… I’m not sure how-to exactly edit this line of code to basically just say “show the damn slide show no matter what!” Yes… This is all the code in index.php:

<?php get_header(); ?>
<?php if (have_posts()) : ?>


<div id="index" class="post clearfix">

	<?php
	$paged = $wp_query->get( 'paged' );
    if(!$paged) { require( TEMPLATEPATH . '/includes/slides.php'); } ?>

	<?php get_template_part( 'loop', 'entry') ?>
</div>

<?php get_sidebar(); ?>
<?php endif; ?>
<?php get_footer(); ?>

That’s it… Any help would be GREATLY appreciated!

THANKS!

-scott g

<?php get_header(); ?>
<?php if (have_posts()) : // REMOVE THIS LINE ?>


<div id="index" class="post clearfix">

    <?php
    $paged = $wp_query->get( 'paged' );
    if(!$paged) { require( TEMPLATEPATH . '/includes/slides.php'); } ?>

    <?php get_template_part( 'loop', 'entry') ?>
</div>

<?php get_sidebar(); ?>
<?php endif;  // REMOVE THIS LINE ?>
<?php get_footer(); ?>

If you remove the two lines I designated in your script, it should always show the slideshow and the sidebar.

Thanks @cpradio!

That works! With no posts to display! Is there a line of code that can be added so the slideshow will continue to show on the main index if I change the “Reading Settings” to display a static page?! The site is stlheroinhelp.org.

Super quick and helpful response these forums are spot-on! Thank you!

-scott g

That is a good question. For that I think you would need to make a new page template, paste the code you have in there, and then set the front page to that new template page. Since the slider requires PHP code, you can’t just point to a regular page, that page will have to utilize a new template that has the PHP code embeded in it.

Here are what I believe the step by step instructions would be
Open your site via FTP
Download the Theme’s page.php file
Rename it to page-with-slider.php
Upload it back to the Theme folder
Login to your Dashboard
Go to the Appearance > Editor
Click on the page-width-slider.php.
Add the following line above “* The template for displaying all pages.”

 * Template Name: Page with Slider

Paste the following lines where you want the slider to appear

    <?php
    $paged = $wp_query->get( 'paged' );
    if(!$paged) { require( TEMPLATEPATH . '/includes/slides.php'); } ?>

Click Update File

If you already have a page created for your front-page, Edit it and select the Page with Slider Template under Page Attributes
Otherwise, create a new Page and select the Page with Slider Template under Page Attributes

CPRADIO!

Thank you so much for taking the time to help me out… I would have never guessed to whip together a new page template. Brilliant! Works great!

THANK YOU!

-scott g

Your welcome and I’m glad it worked :slight_smile: