• 17-07-2015, 02:06:49
    #1
    Arkadaşlar aşağıdaki kod ile description kusmını çekebiliyorum ama tamamını alıyor. Bunu sınırlandırabilir miyim?

    <head>
    <meta name="description" content="<?php echo get_post_meta($post->ID, 'desc', true); ?>" />
    </head>

    Fuctions.php
    function be_attachment_field_credit( $form_fields, $post ) {
    	$form_fields['description'] = array(
    		'label' => 'Description',
    		'input' => 'text',
    		'value' => get_post_meta( $post->ID, 'desc', true ),
    	);
    
    	return $form_fields;
    
    function be_attachment_field_credit_save( $post, $attachment ) {
    	if( isset( $attachment['description] ) )
    		update_post_meta( $post['ID'], 'desc', $attachment['description'] );
    }
    
    	return $post;
    }
    
    add_filter( 'attachment_fields_to_save', 'be_attachment_field_credit_save', 10, 2 );
  • 17-07-2015, 02:46:48
    #2
    substr fonksiyonunu kullanın
    substr($veri,$baslangic,$bitis);
    
    substr($veri,0,100);
  • 17-07-2015, 02:49:42
    #3
    head /head arasında kodu yazdırırken echo $değişgken kısmını şu şekilde değiştirin.

    echo substr($degisken,0,250); tarzında yaparsanız çalışacaktır.
  • 17-07-2015, 21:48:24
    #4
    sonbaron adlı üyeden alıntı: mesajı görüntüle
    substr fonksiyonunu kullanın
    substr($veri,$baslangic,$bitis);
    
    substr($veri,0,100);
    U_uR adlı üyeden alıntı: mesajı görüntüle
    head /head arasında kodu yazdırırken echo $değişgken kısmını şu şekilde değiştirin.

    echo substr($degisken,0,250); tarzında yaparsanız çalışacaktır.
    Cevaplarınız için teşekkür ederim. Fakat iki yoluda denedim olmadı. Galiba ben yapamadım. Zahmet olmazsa aşağıdaki kodu siz düzenleyebilir misiniz?

    <meta name="description" content="<?php echo get_post_meta($post->ID, 'anla', true); ?>" />
    
    .
  • 17-07-2015, 23:16:35
    #5
    <meta name="description" content="<?php echo substr(get_post_meta($post->ID, 'anla', true),0,100); ?>" />
  • 17-07-2015, 23:22:56
    #6
    sonbaron adlı üyeden alıntı: mesajı görüntüle
    <meta name="description" content="<?php echo substr(get_post_meta($post->ID, 'anla', true),0,100); ?>" />
    Oldu hocam çok teşekkür ederim.