• Hi there

    We got a custom wordpress-theme on http://www.sp-entlebuch.ch/, but I can’t reach the developper for the moment, so I need to ask community.
    As I mentioned, if you click on either of the category-links (“Aktuell“, “Standpunkte“), posts of any category show u, and not only the ones desired.
    If I change theme, categories work fine. If I change the code of the custom theme’s category.php with the one of TwentyFourteen, no more posts are shown. Same if I rename the file.
    So either it’s the category.php-file or the loop.php that’s causing the trouble. I don’t know a lot about php, so here’s the code of the two files. Maybe someone finds something.

    Category.php:

    <?php get_header(); ?>
    
    	<section class="row hr-title">
    		<h6 class="small">Alle Beiträge in der Kategorie <?php single_cat_title(); ?></h6>
    		<hr class="col-md-12">
    	</section>
    
    	<!-- section -->
    	<section role="main" class="row trigger" id="container">
    
    		<?php get_template_part('loop'); ?>
    
    		<?php get_template_part('pagination'); ?>
    
    	</section>
    	<!-- /section -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    loop.php

    <?php $latest = new WP_Query('showposts=10'); $postCount = 0; ?>
    
    <ul id="blog-list">
    
    <?php
    if ( $latest->have_posts()): while ( $latest->have_posts()) :  $latest->the_post(); ?>
    	<?php if(has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium'); }
    	$postCount = $postCount+1;
    	?>
    	<li>
    		<article id="post-<?php the_ID(); ?>" <?php post_class(array('placeholder')); ?>>
    			<div class="post-main row">
    				<aside class="post-image col-sm-3" style="background-image:url(<?php echo $thumb[0]; ?>);">
    					<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
    						<img src="<?php echo get_template_directory_uri(); ?>/img/maske.png" class="img-responsive">
    					</a>
    				</aside>
    				<section class="col-sm-8">
    					<h4 class="main-title">
    						<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    					</h4>
    					<p><small>Am <?php the_date( 'j.F.Y' ); ?></small></p>
    					<p class="main-content">
    						<?php the_excerpt(); ?>
    					</p>
    				</section>
    			</div>
    		</article>
    	</li>
    	<?php if ($latest->current_post +1 !== $latest->post_count) { echo('<hr class="col-sm-8 col-sm-offset-3">'); } ?>
    
    <?php endwhile; ?>
    
    <?php else: ?>
    
    	<!-- article -->
    	<article>
    		<h2><?php _e( 'Sorry, nothing to display.', 'angelozehr' ); ?></h2>
    	</article>
    	<!-- /article -->
    
    <?php endif; ?>
    </ul>

    Thanks in advance.

The topic ‘All categorys shown in custom theme’ is closed to new replies.