Bu konuya google'dan geldiyseniz burayada bakmak isteyebilirsiniz: https://www.r10.net/showthread.php?p=1065675953
Arkadaşlar wordpress'te yazarların sadece kendi yazdıklarını görebilmesini istiyorum fakat başaramadım
<?php global $current_user;
get_currentuserinfo();
$uyeidd = ". $current_user->ID .";
print $uyeidd;
?> Üye girişi yapan üyenin id'sini bu şekilde çekiyorum ve $uyeidd değişkenine atıyorum
<?php $yaziidd = the_author_ID(); ?>
Bu şekildede yazıyı yazan üyenin id'sini çekiyorum fakat
<?php if ($yaziidd == $uyeidd) : ?>
Bu kod işe yaramıyor
Acaba integer string olayları yüzünden mi dedim string'i integer'a çevirdim ($uyeidd integer yaptım) fakat $uyeidd nin türü NULL gözüküyor (ekrana basınca düzgün-doğru sayı olarak basmasına rağmen) onuda integer'a çevirdim genede olmadı
Çalışmasını umuduğum kod buydu; (index.php)
<?php get_header(); ?>
<div id="contentcontainer" class="grid_9 alpha">
<div id="content">
<?php $counter = 0; ?>
[COLOR="Red"] <?php global $current_user;
get_currentuserinfo();
$uyeidd = ". $current_user->ID .";
print $uyeidd;
print gettype( $uyeidd ) ;
settype( $uyeidd, integer );
print gettype( $uyeidd ) ;
?>[/COLOR]
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
[COLOR="Red"]<?php
$yaziidd = the_author_ID();
print $yaziidd;
print("Türü : ");
settype( $yaziidd, integer );
print gettype( $yaziidd ) ;
?> <?php if ($yaziidd == $uyeidd) : ?>[/COLOR]
<?php $counter++; ?>
<div class="post">
<div class="meta grid_2 alpha">
<ul>
<li class="auth"><?php the_author_posts_link(); ?></li>
<li class="date"><?php the_time('j F Y'); ?><br /> <?php the_time('H:i'); ?></li>
<li class="comms"><a href="<?php comments_link(); ?>"><?php comments_number('0','1','%'); ?> <?php _e('Yorum',woothemes); ?></a></li>
</ul>
</div><!--grid_2-->
<div class="postbody grid_7 omega <?php if ( $counter == 1 ) { ?>first<?php } ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<p><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"></a></p>
</div><!--entry-->
</div><!--grid_7-->
<div class="clearfix"></div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
</div><!--content-->
<div class="clearfix"></div>
<div id="postnav">
<div class="fl"><?php next_posts_link(__('« Eski Yazılar',woothemes)); ?></div>
<div class="fr"><?php previous_posts_link(__('Yeni Yazılar »',woothemes)); ?></div>
<div class="clearfix"></div>
</div><!--postnav-->
</div><!--contentcontainer-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>Kodu while'dan önce almayıda denedim while'ın içine almayıda denedim nerede yanlış yaptığımı yada hangi mantığı yanlış kurduğumu anlamadım