Wsparcie » Motywy » Problem z wyświetlaniem wpisów

Viewing 4 replies - 1 through 4 (of 4 total)
  • Wrzuć kod jak je wyświetlasz 🙂

    Thread Starter nnww

    (@nnww)

    Dzięki za odpowiedź.
    Gdzie znajdę ten kod?

    Thread Starter nnww

    (@nnww)

    To pewnie będzie to:

    <?php
    /**
     * The template for displaying Category Archive pages.
     *
     * @package WordPress
     * @subpackage Twenty_Eleven
     * @since Twenty Eleven 1.0
     */
    
    get_header(); 
    
    $category = get_the_category();
    
    if($category[0]->cat_ID==23) $args = array('cat'=>$category[0]->cat_ID,'meta_key'=>'sequence','orderby'=>'meta_value','order'=>'ASC'); else
    $args = array('cat'=>$category[0]->cat_ID,'orderby'=>'date','order'=>'DESC');
    
    query_posts(  $args , $wp_query->query );
    ?>
    
    		<div class="category">
    
    			<?php if ( have_posts() ) : ?>
    
    			<h1 class="category_title"><?php echo single_cat_title( '', false ); ?></h1>
    
    			<div class="category_desc"><?php echo category_description('') ;?> </div>
    			<hr id="logo_hr"/>
    
    </div>	
    
    				 		<div id="category">
    
    				<?php /* Start the Loop */
    				switch($category[0]->cat_ID)
    				{
    					case 4:
    					$thumb_size=220;
    					break;
    					case 5:
    					$thumb_size=220;
    					$more="";
    					break;
    					default:
    					$thumb_size=220;
    					break;
    				}
    				?>
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    						 			<!-- category Content -->
    			<div id="category_content" >
    						 				<!-- category Articles -->
    				<div style="position: relative; " id="spotlight">
    
    											<div style="position: relative; top: 0px; left: 0px; display: block; opacity: 1;" class="slide">
    							<h1 <?php if($category[0]->cat_ID==5) echo 'style="font-size:1.7em;"'; ?> > <?php the_title(); ?></h1>
    							<br class="clear">
    
    		<?php if ( has_post_thumbnail() ) :?> <a href="<?php the_permalink(); ?>" title="<?php echo get_the_title(); ?>">
    		<?php
    					$src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 750,750 ), false, '' );
    					$thumbnailSrc = $src[0];
    		?>
    							<img src="<?php bloginfo('template_directory'); ?>/include/timthumb.php?src=<?php echo $thumbnailSrc; ?>&h=<?php echo $thumb_size;?>&w=<?php echo $thumb_size;?>&zc=1&q=100" class="category_img" alt="<?php the_title(); ?>">
    						</a>			
    
    			<?php else : 	//the current post does not have a thumbnail, do something else? ?>
    			<?php endif; ?>
    
    				<div class="category_content" >
    						<?php the_content('<span class="readmore_c">'.__( 'More', 'twentyeleven' ).'&rarr; </span>'); ?>
    
    				</div>
    
    </div>
    </div>
    
    									<!-- End category Articles -->
    											</div>
    			<!-- End category Content -->
    
    						 <?php
    
    		//				get_template_part( 'content', get_post_format() );
    					?>
    
    				<?php endwhile; ?>
    
    				<?php twentyeleven_content_nav( 'nav-below' ); ?>
    
    		</div>
    
    			<?php else : ?>
    
    				<article id="post-0" class="post no-results not-found">
    					<header class="entry-header">
    						<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    					</header><!-- .entry-header -->
    
    					<div class="entry-content">
    						<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    						<?php get_search_form(); ?>
    					</div><!-- .entry-content -->
    				</article><!-- #post-0 -->
    
    			<?php endif; ?>
    
    <?php get_footer(); ?>

    Thread Starter nnww

    (@nnww)

    Winowajca:
    $category = get_the_category();

Viewing 4 replies - 1 through 4 (of 4 total)
  • Temat ‘Problem z wyświetlaniem wpisów’ jest zamknięty na nowe odpowiedzi.