• 08-03-2009, 14:11:14
    #1
    Örnek:

    http://www.**********/wordpress-test/?p=17 bu konutu anasayfadan tıklandığında http://www.xxsdsds.com adresine yönlenmesini istiyorum bunu nasıl yapabilirim?

    htacess'le mümkünmüdür? Bir kaç tane konunun linkine böyle yapmak istiyorum.
  • 08-03-2009, 14:49:28
    #2
    temanızın functions.php dosyasını açıp,
    ?>
    etiketinden önce şu satırları ekleyin:

    function print_post_title() {
    	global $post;
    	$thePostID = $post->ID;
    	$post_id = get_post($thePostID);
    	$title = $post_id->post_title;
    	$key = "yenilink";
    	$perm  = get_permalink($post_id);
    	$customval = get_post_meta($thePostID, $key, true);
    
    	if (!empty($customval)) {
      	   $link = $customval;
      	  } else {
      	  $link = $perm;
    	}
    	echo '<h2><a href="'.$link.'" rel="bookmark" title="'.$title.'">'.$title.'</a></h2>';
    }
    daha sonra temanızın index.php dosyasını açıp, şu satırı:
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    şöyle değiştirin:
    <?php print_post_title() ?>
    Şimdi ana işlemleri yaptık. Artık tek yapmanız gereken, dış bağlantı vermek istediğiniz bir yazıda, özel alanlarda "yenilink" adıyla bir özel alan oluşturup, içine dış bağlantı adresini yazmak.
  • 08-03-2009, 19:21:06
    #3
    Alıntı
    <?php $link = get_post_meta($post->ID,’yonlendirme‘, true);
    if($link != "") { ?>
    <h2><a href="<? echo strtolower($link); ?>" rel="bookmark" title="Permanent Link"> <?php the_title(); ?></a></h2>
    <?php }else{ ?>
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link"> <?php the_title(); ?></a></h2>
    <?php } ?>
    farklı bir yöntem

    özel alan değişkeni olarak yonlendirme girin. index.php deki

    Alıntı
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link"> <?php the_title(); ?></a></h2>
    bu kodla değiştirin