Misafir adlı üyeden alıntı: mesajı görüntüle
dosyasındaki satır 1050 yüzünden geri alındı. Lütfen düzeltin ve tekrar kaydetmeyi deneyin.
syntax error, unexpected '$args' (T_VARIABLE)
böyle hata aldım hocam ?
add_action('init', 'rastgele_yazi');
function rastgele_yazi(){
    if ( isset($_GET['rastgele']) ){
        $args = array( 
            'post_type' => 'product', 
            'posts_per_page' => 1, 
            'post_status' => 'publish',
            'orderby' => 'rand',
            'category__not_in' => array( 314,512 ),
        );

$random = new WP_Query($args);
if ($random->have_posts()) {
    while ($random->have_posts()) : $random->the_post();
        $URL = get_permalink();
    endwhile; ?>
     
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/URL]">
<html xmlns="[URL]http://www.w3.org/1999/xhtml[/URL]">
<head>
<meta http-equiv="Refresh" content="0; url=<?php echo $URL; ?>">
</head>
<body>
</body>
</html>
<?php }
        die;
    }
}