Skip to content

Problem with slideshow [moved] #17

Open
zyml opened this Issue Aug 6, 2012 · 0 comments

1 participant

@zyml
Owner
zyml commented Aug 6, 2012

This is Issue 91 moved from a Google Code project.
Added by 2010-10-07T06:21:53.000Z by asev...@me.com.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

<b>What steps will reproduce the problem?</b>

I can't seem to find a step that WON'T reproduce the problem.

<b>What is the expected output? What do you see instead?</b>

I expect an image from each post that I choose to appear in the slideshow to appear and scroll like a slideshow. I can only get one image to appear in the slideshow and clicking the arrows at the side of the slideshow cause the homepage to reload with the same image in the slideshow.

<b>What versions of WordPress and Arras Theme are you using?</b>

 WordPress 3.0.1
 Arras 1.5.0.1

I also have these plugins installed and activated:

 JW Player Plugin for WordPress Version 1.2.4
 Wordpress Google Calendar Version 0.8.5


<b>Please include the link to your installation.</b>

http://istatefans.co.cc/

<b>Please provide any additional information below.</b>

I'm pretty new to wordpress and code, so the issue could be anything.

In Arras > Theme Options > Home > Slideshow, Selected Post Type=Posts and Post Tags=slideshow. I added the tag &quot;slideshow&quot; to the posts I want in the slideshow. In Arras > Post Types & Tax. > Post Types, Slideshow=Posts and in Arras > Post Types & Tax. > Taxonomies, Slideshow=Post Tags.

I am using bytehost.com as a host because it is free and I am a broke student.

Here is my slideshow.php code. I haven't changed it from what it was at installation (at least not on purpose).

<?php 

function arras_add_slideshow() {
    global $post_blacklist;
    if (!is_home()) return false;

    $slideshow_cat = arras_get_option('slideshow_cat');

    if (arras_get_option('enable_slideshow') == false) return false;

    $query = arras_parse_query($slideshow_cat, arras_get_option('slideshow_count'), array_unique($post_blacklist), arras_get_option('slideshow_posttype'), arras_get_option('slideshow_tax'));

    $q = new WP_Query( apply_filters('arras_slideshow_query', $query) );
    if ($q->have_posts()) :
    ?> 
    <!-- Featured Slideshow -->
    <div class=&quot;featured clearfix&quot;>
        <?php if ($q->post_count > 1) : ?>
        <div id=&quot;controls&quot;>
            <a href=&quot;&quot; class=&quot;prev&quot;><?php _e('Prev', 'arras') ?></a>
            <a href=&quot;&quot; class=&quot;next&quot;><?php _e('Next', 'arras') ?></a>
        </div>
        <?php endif ?>
        <div id=&quot;featured-slideshow&quot;>
            <?php $count = 0; ?>

            <?php while ($q->have_posts()) : $q->the_post(); ?>
            <div class=&quot;featured-slideshow-inner&quot; <?php if ($count != 0) echo 'style=&quot;display: none&quot;'; ?>>
                <a class=&quot;featured-article&quot; href=&quot;<?php the_permalink(); ?>&quot; rel=&quot;bookmark&quot;>
                <?php echo arras_get_thumbnail('featured-slideshow-thumb'); ?>
                </a>
                <div class=&quot;featured-entry&quot;>
                    <a class=&quot;entry-title&quot; href=&quot;<?php the_permalink(); ?>&quot; rel=&quot;bookmark&quot;><?php the_title(); ?></a>
                    <div class=&quot;entry-summary&quot;><?php the_excerpt() ?></div>
                    <div class=&quot;progress&quot;></div>
                </div>
            </div>
            <?php 
            arras_blacklist_duplicates(); // required for duplicate posts function to work.
            $count++; endwhile; ?>
        </div>
    </div>
    <?php endif;
}

add_action('arras_above_content', 'arras_add_slideshow');

function arras_add_slideshow_js() {
?>
<script type=&quot;text/javascript&quot;>
jQuery(document).ready(function($) {

<?php if (is_home() || is_front_page()) : ?>
$('#featured-slideshow').cycle({
    fx: 'fade',
    speed: 250,
    next: '#controls .next',
    prev: '#controls .prev',
    timeout: 6000,
    pause: 1,
    slideExpr: '.featured-slideshow-inner',
    height: '<?php $size = arras_get_image_size('featured-slideshow-thumb'); echo $size['h']; ?>px'
});
<?php endif ?>

});
</script>
<?php
}
add_action('wp_footer', 'arras_add_slideshow_js');

function arras_add_slideshow_thumb_size() {
    $layout = arras_get_option('layout');

    if ( strpos($layout, '1c') !== false ) {
        $size = array(950, 300);
    } else if ( strpos($layout, '3c') !== false ) {
        $size = array(490, 225);
    } else {
        $size = array(640, 250);
    }

    $size = apply_filters('arras_slideshow_thumb_size', $size);
    arras_add_image_size( 'featured-slideshow-thumb', __('Featured Slideshow', 'arras'), $size[0], $size[1]);
}
add_action('arras_add_default_thumbnails', 'arras_add_slideshow_thumb_size', 5);

function arras_slideshow_styles() {
    $slideshow_size = arras_get_image_size('featured-slideshow-thumb');
    $slideshow_size_w = $slideshow_size['w'];
    $slideshow_size_h = $slideshow_size['h'];
    ?>
    .featured { height: <?php echo $slideshow_size_h + 10 ?>px; }
    .featured-article { width: <?php echo $slideshow_size_w ?>px; height: <?php echo $slideshow_size_h ?>px; }
    .featured-article img { width: <?php echo $slideshow_size_w ?>px; height: <?php echo $slideshow_size_h ?>px; }
    #controls { width: <?php echo $slideshow_size_w - 30 ?>px; top: <?php echo ($slideshow_size_h / 2) - 15 ?>px; }
    #controls .next { left: <?php echo $slideshow_size_w - 30 ?>px; }
    .featured-entry { height: <?php echo ceil($slideshow_size_h / 3) ?>px; top: -<?php echo ceil($slideshow_size_h / 3) ?>px; }
    .featured-slideshow-inner { height: <?php echo $slideshow_size_h ?>px }
    <?php
}
add_action('arras_custom_styles', 'arras_slideshow_styles');

/* End of file slideshow.php */
/* Location: ./library/slideshow.php */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.