2013-06-16 1 views
2

1 div id, 1 big class, 1 small class에 2 개의 추천 게시물이 있습니다. 큰 특집 div가 카테고리 기반에 게시하고 싶습니다. 아래에 큰 특집 게시물 코드가 표시됩니다.카테고리베이스에서 추천 게시물 쇼를 할 수있는 방법

<div class="main_feat">  
      <?php get_the_image(array('size' => 'featured', 'width' => 310, 'before' => '<div class="thumb">', 'after' => '</div>')); ?>  
      <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> </h2> 
      <div class="date"><?php if (option::get('featured_date_format') == 'time ago') { echo time_ago(); } else { printf('%s, %s', get_the_date(), get_the_time()); } ?></div>  
      <div class="content"> 
       <div class="entry"> 
        <?php the_excerpt(); ?>  
        <div class="meta"> 
         <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" class="nextActions"><?php _e('সম্পূর্ন অংশটুকু', 'wpzoom'); ?> &rarr;</a>       <span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span><div class="clear"></div> 
        </div>  
       </div><!-- /.entry --> 
      </div><!-- /.content --> 
    </div> 

이 div 클래스 카테고리 기반을 만들고 싶습니다. 카테고리 이름이 있다고 가정 해 보겠습니다. 나는이 클래스의 카테고리 카테고리 기반을하고 싶다.

아래의 추천 전체 코드 쇼 ... 내가이 일을 할 것이라고 생각

<div id="featured"> 
    <?php 
    $featured = new WP_Query(array(
     'showposts' => option::get('featured_art_number'), 
     'post__not_in' => get_option('sticky_posts'), 
     'meta_key' => 'wpzoom_is_featured', 
     'meta_value' => 1 
    )); 
    if ($featured->post_count > 0) : $i = 0; 
    while($featured->have_posts()) { $featured->the_post(); global $post; $i++; 
    if ($i == 1) 
     { ?> 
     <div class="main_feat"> 
      <?php get_the_image(array('size' => 'featured', 'width' => 310, 'before' => '<div class="thumb">', 'after' => '</div>')); ?> 
      <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a> </h2> 
      <div class="date"><?php if (option::get('featured_date_format') == 'time ago') { echo time_ago(); } else { printf('%s, %s', get_the_date(), get_the_time()); } ?></div> 
      <div class="content"> 
       <div class="entry"> 
        <?php the_excerpt(); ?> 
        <div class="meta"> 
         <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>" class="nextActions"><?php _e('সম্পূর্ন অংশটুকু', 'wpzoom'); ?> &rarr;</a> 
         <span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span><div class="clear"></div> 
        </div> 
       </div><!-- /.entry --> 
      </div><!-- /.content --> 
     </div> 
     <div class="headings"> 
      <ul> 
    <?php } else { ?> 
       <li> 
        <h2><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> 
        <?php get_the_image(array('size' => 'featured-small', 'width' => 100, 'height' => 75, 'before' => '<div class="post-thumb">', 'after' => '</div>')); ?> 
        <?php the_content_limit(option::get('featured_excerpt')); ?> 
        <div class="clear"></div> 

        <div class="meta"> 
         <?php printf('%s, %s', get_the_date(), get_the_time()); ?> 
         <span class="comments"><?php comments_popup_link('0', '1', '%'); ?></span> 
        </div> 
       </li> 
       <?php } 
       $i ++; } ?> 
      </ul> 
     </div> 
    <?php endif; ?> 
    <?php wp_reset_query(); ?> 
    <div class="clear"></div> 
</div> <!-- /#featured --> 
<div class="clear"></div> 
당신이 사용하고자하는 div에이 코드를 사용할 수 있습니다

답변

1

...

<?php query_posts('orderby=name&order=asc&cat=43&showposts=100'); ?> 
<?php while (have_posts()) : the_post(); ?> "> 
<?php the_title(); ?> <?php endwhile;?> 

...

관련 문제