• Hello everybody,

    I would like to use the slideshow of the Arras-Template:
    see https://demo.arrastheme.com/

    Everything is working fine in the main menu. The template shows ALL posts in ALL categories.

    But I would like to create a seperate slideshow for each category. So only the posts of category 4 are shown in the slideshow shown in cat=4. Posts of other categories are excluded!

    The relevant code:

    <?php if ( ( $featured1_cat = arras_get_option('featured_cat1') ) !== '' && $featured1_cat != '-1' ) : ?>
        <!-- Featured Articles #1 -->
        <div class="featured clearfix">
        <?php
    	if ($featured1_cat == '-5') 	$query = array('post__in' => get_option('sticky_posts'), 'showposts' => arras_get_option('featured1_count') );
    	elseif ($featured1_cat == '0') 	$query = 'showposts=' . arras_get_option('featured1_count');
    	else							$query = 'showposts=' . arras_get_option('featured1_count') . '&cat=' . $featured1_cat;
    
    	$q = new WP_Query( apply_filters('arras_featured1_query', $query) );
    	?>
        	<div id="controls" style="display: none;">
    			<a href="" class="prev"><?php _e('Prev', 'arras') ?></a>
    			<a href="" class="next"><?php _e('Next', 'arras') ?></a>
            </div>
        	<div id="featured-slideshow">
            	<?php $count = 0; ?>
        		<?php if ($q->have_posts()) : while ($q->have_posts()) : $q->the_post(); ?>
        		<div <?php if ($count != 0) echo 'style="display: none"'; ?>>
        			<?php $w = 630; $h = 250; if ( arras_get_option('layout') == '3c-r-fixed' || arras_get_option('layout') == '3c-fixed' ) { $w = 480; $h = 225; } ?>
                	<a class="featured-article" href="<?php the_permalink(); ?>" rel="bookmark" style="background: url(<?php echo arras_get_thumbnail($w, $h); ?>) no-repeat;">
                    <span class="featured-entry">
                        <span class="entry-title"><?php the_title(); ?></span>
                        <span class="entry-summary"><?php echo arras_strip_content(get_the_excerpt(), 20); ?></span>
    					<span class="progress"></span>
                    </span>
                	</a>
            	</div>
        		<?php $count++; endwhile; endif; ?>
        	</div>
        </div>
    <?php endif; ?>

    Where do I habe to change the code that only the posts e.g. of category 4 are shown within the slideshow?

    Looking forward for your help! Thanks a lot!

    ////

    Hallo zusammen,

    ich würde gerne die Slideshow das Arras-Templates nutzen:
    vgl. https://demo.arrastheme.com/

    Das klappt im Hauptmenu auch wunderbar. Das Template zeigt ALLE Posts.

    Ich würde aber auch gerne für jedes Archive eine eigene Slideshow machen, die aus den Posts dieses Archives besteht. Also NICHT ALLE, sondern nur die mit dem Archiv verknüpften Posts sollen in der Slideshow angezeigt werden.

    Der Quellcode für die normale Anzeige im Hauptmenu:

    <?php if ( ( $featured1_cat = arras_get_option('featured_cat1') ) !== '' && $featured1_cat != '-1' ) : ?>
        <!-- Featured Articles #1 -->
        <div class="featured clearfix">
        <?php
    	if ($featured1_cat == '-5') 	$query = array('post__in' => get_option('sticky_posts'), 'showposts' => arras_get_option('featured1_count') );
    	elseif ($featured1_cat == '0') 	$query = 'showposts=' . arras_get_option('featured1_count');
    	else							$query = 'showposts=' . arras_get_option('featured1_count') . '&cat=' . $featured1_cat;
    
    	$q = new WP_Query( apply_filters('arras_featured1_query', $query) );
    	?>
        	<div id="controls" style="display: none;">
    			<a href="" class="prev"><?php _e('Prev', 'arras') ?></a>
    			<a href="" class="next"><?php _e('Next', 'arras') ?></a>
            </div>
        	<div id="featured-slideshow">
            	<?php $count = 0; ?>
        		<?php if ($q->have_posts()) : while ($q->have_posts()) : $q->the_post(); ?>
        		<div <?php if ($count != 0) echo 'style="display: none"'; ?>>
        			<?php $w = 630; $h = 250; if ( arras_get_option('layout') == '3c-r-fixed' || arras_get_option('layout') == '3c-fixed' ) { $w = 480; $h = 225; } ?>
                	<a class="featured-article" href="<?php the_permalink(); ?>" rel="bookmark" style="background: url(<?php echo arras_get_thumbnail($w, $h); ?>) no-repeat;">
                    <span class="featured-entry">
                        <span class="entry-title"><?php the_title(); ?></span>
                        <span class="entry-summary"><?php echo arras_strip_content(get_the_excerpt(), 20); ?></span>
    					<span class="progress"></span>
                    </span>
                	</a>
            	</div>
        		<?php $count++; endwhile; endif; ?>
        	</div>
        </div>
    <?php endif; ?>

    Wo muss ich einstellen, dass ich bspw. nur die Posts der Category 4 angezeigt haben m?chte?

    W?re klasse, wenn einer eine Idee hat ??
    Freue mich auf euer Feedback und wünsche eine gute Nacht!

Viewing 1 replies (of 1 total)
  • Try this..

    <div class="featured clearfix">
      <div id="controls" style="display: none;">
      	<a href="" class="prev"><?php _e('Prev', 'arras') ?></a>
        <a href="" class="next"><?php _e('Next', 'arras') ?></a>
      </div>
      <div id="featured-slideshow">
    	<?php if(have_posts()) : ?>
    		<?php while(have_posts()) : the_post(); ?>
    
      		<?php $ = new WP_Query('cat=5&showposts=4'); ?>
      		<?php while($frontpage->have_posts()) : $frontpage->the_post(); ?>
    
        	<div <?php if ($count != 0) echo 'style="display: none"'; ?>>
          <?php $w = 630; $h = 250; if ( arras_get_option('layout') == '3c-r-fixed' || arras_get_option('layout') == '3c-fixed' ) { $w = 480; $h = 225; } ?>
    
          <a class="featured-article" href="<?php the_permalink(); ?>" rel="bookmark" style="background: url(<?php echo arras_get_thumbnail($w, $h); ?>) no-repeat;">
    
          <span class="featured-entry">
          	<span class="entry-title"><?php the_title(); ?></span>
            <span class="entry-summary"><?php echo arras_strip_content(get_the_excerpt(), 20); ?></span>
            <span class="progress"></span>
          </span>
    
      	<?php endwhile; else: ?>
    
    	<?php endif; ?>
    	</div>
    </div>

Viewing 1 replies (of 1 total)
  • The topic ‘Arras-Template: Seperate slideshow for each Category’ is closed to new replies.