Alıntı
<?php
// Get $post if you're inside a function
global $post;
if ( is_single('63') ) {
//
<div class="adsense-post">
<ul>
<?php
global $post;
$myposts = get_posts('numberposts=5&offset=1&category=187');
foreach($myposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
}
?>
Kodu yanlış olmuş. Doğrusu
Alıntı
<?php
// Get $post if you're inside a function
if ( is_single('63') ) {
?>
<div class="adsense-post">
<ul>
<?php
$myposts = get_posts('numberposts=5&offset=1&category=187');
foreach($myposts as $post) :
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
<?php
}
?>
PHP kodlarıyla html kodlarını birbirine karıştırmayın, php kodlarını kapadıktan sonra html kodlarını kullanmalısınız. Ayrıca eğer doğrudan single.php içerisinde kullanıyorsanız kodları global $post demeye gerek yok.