İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

Wp'de sadece belli kategoriler

erdjan

0
İyinet Üyesi
Katılım
30 Nisan 2008
Mesajlar
53
Reaction score
1
Merhaba Arkadaslar;

Simdi Wordpress'in ana sayfasinda belirledigim bir kategoriyi ana sayfada gostermek istiyorum.

Yani hem resimleri hemde yanina kisa aciklamasi gelecek sekilde olucak..

Ama bir turlu kodlari tutturamadim. devamli hata veriyor.

Ama bilen var mi istenilen yerde istenilen kategori gosterilebilir mi?

Mesela



Bu sagda belirtilen yerlerde otomatik geliyor bunun yerine benim belirledigim 1 kategorinin cikmasini istiyorum. Bu konuda yarimdi olabilirmisiniz?


Simdiden tesekkurler
 

erdjan

0
İyinet Üyesi
Katılım
30 Nisan 2008
Mesajlar
53
Reaction score
1
Bu yukaridaki belirttigim yerdeki kodlar su sekilde;;

<?php $myPosts .= "0"; add_filter('posts_where', 'post_strip'); ?>
<?php $showpost = new WP_query(); $showpost->query('showposts='.$carpet['regular_video_posts_X'].'&cat='.$carpet['videos_id']); ?>
<?php if ($showpost->have_posts()) : ?>
<div class="box_type_a more_videos">
<?php while ($showpost->have_posts()) : $showpost->the_post(); $myPosts .= $post->ID . ","; ?>
<div class="more_vid">
<div class="pic-alt"><?php show_photo($carpet['normal_thumb_w'],$carpet['normal_thumb_h']); ?></div>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<p><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php print do_excerpt(get_the_excerpt(), $carpet['snippet_level2']); ?></a></p>
<ul class="etc">
<li class="readit"><a href="<?php the_permalink(); ?>">Izle</a></li>
</ul><div class="clear"></div>
</div>

Bunlari nasil duzenlersem benim belirledigim bir kategorideki iki yazi burda goruntulenir?


Tesekkurler simdiden
 

dahi

0
İyinet Üyesi
Katılım
15 Ekim 2007
Mesajlar
166
Reaction score
0
// Aşağıdaki cat=11]rakamını göstermek istediğiniz kategori ID'si ile değiştirin.
// showposts=3 gösterilecek kayıt sayısıdır, istediğiniz şekilde değiştirebilirsiniz.
// "resim" yazan yere özel alandan ekliyeceğin etiket ile çağıracagın resim gelir
// "/images/thumbnail.png" olan yere özel resim atanmayanlara otomatik çıkacaktır
// width="80" height="70" resimlerin göstermek istediğin boyutlandırısın
// <?php the_content_limit(95, ""); ?> 95 kaç half karakter çıkmasını istiyorsan onu ayarlarsın
// /category/dusunce-iklimi/ ile kategorinin devamındaki yazılara yönlendirirsin

Kod:
<h3>Kategori ismi</h3>
				<?php
				?>
				<?php $recent = new WP_Query("cat=11&showposts=3"); while($recent->have_posts()) : $recent->the_post();?>
				<?php if( get_post_meta($post->ID, "resim", true) ): ?>
				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "resim", true); ?>" alt="<?php the_title(); ?>" width="80" height="70" /></a>
				<?php else: ?>
				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" width="80" height="70" /></a>
				<?php endif; ?>				
				<b><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></b>
				<?php the_content_limit(95, ""); ?>
				
				<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
				
				<?php endwhile; ?>

				<b><a href="/category/dusunce-iklimi/" rel="bookmark">Bu kategorideki tüm gönderiler</a></b>
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst