- Mesajlar
- 352
Arkadaşlar wp Point free temasını kullanıyorum. Temanının manşet alanında 4 adet içerik çekiliyor. Temanın yönetim panelinde içeriğin çekileceği kategoriyi belirleyebiliyorum.
Manşeti, belirlediğim post ide göre içeriği çekecek şekilde ayarlamamız mümkün mü?
Manşetin çekildiği kodlar:
Manşeti, belirlediğim post ide göre içeriği çekecek şekilde ayarlamamız mümkün mü?
Manşetin çekildiği kodlar:
<?php if(isset($mts_options['mts_featured_slider'])) { if($mts_options['mts_featured_slider'] == '1' && $mts_options['mts_featured_slider'] != '') { ?>
<?php if(is_home() && !is_paged()) { ?>
<div class="featuredBox">
<?php $i = 1;
// prevent implode error
if (empty($mts_options['mts_featured_slider_cat']) || !is_array($mts_options['mts_featured_slider_cat'])) {
$mts_options['mts_featured_slider_cat'] = array('0');
}
$slider_cat = implode(",", $mts_options['mts_featured_slider_cat']);
$my_query = new WP_Query('cat='.$slider_cat.'&posts_per_page=4&ignore_sticky_posts=1');
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php if($i == 1){ ?>
<div class="firstpost excerpt">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="first-thumbnail">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('bigthumb',array('title' => '')); ?>
<?php } else { ?>
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/bigthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
</div>
<?php } ?>
<p class="featured-excerpt">
<span class="featured-title"><?php the_title(); ?></span>
<span class="f-excerpt"><?php echo mts_excerpt(10);?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php } elseif($i == 2) { ?>
<div class="secondpost excerpt">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="second-thumbnail">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('mediumthumb',array('title' => '')); ?>
<?php } else { ?>
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/mediumthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
</div>
<?php } ?>
<p class="featured-excerpt">
<span class="featured-title"><?php the_title(); ?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php } elseif($i == 3 || $i == 4) { ?>
<div class="thirdpost excerpt">
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="nofollow" id="third-thumbnail">
<?php if ( has_post_thumbnail() ) { ?>
<?php the_post_thumbnail('smallthumb',array('title' => '')); ?>
<?php } else { ?>
<div class="featured-thumbnail">
<img src="<?php echo get_template_directory_uri(); ?>/images/smallfthumb.png" class="attachment-featured wp-post-image" alt="<?php the_title(); ?>">
</div>
<?php } ?>
<p class="featured-excerpt">
<span class="featured-title"><?php the_title(); ?></span>
</p>
</a>
</div><!--.post excerpt-->
<?php } ?>
<?php $i++; endwhile; wp_reset_query(); ?>
</div>
<?php } ?>
<?php }} ?>