SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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 Code:
    <?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

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,217
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?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.

  3. #3
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,217
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by scott g View Post
    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."
    PHP Code:
     Template NamePage with Slider 
    Paste the following lines where you want the slider to appear
    PHP Code:
        <?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

  5. #5
    SitePoint Enthusiast scott g's Avatar
    Join Date
    Jun 2012
    Location
    STL . MO
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,217
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Your welcome and I'm glad it worked


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •