dinamik olarak ekler misiniz kodunuzu, loop üzerinde mi content çekiyorsunuz single mı görmem lazım.
single ise bir deneyin;
<?php $content = get_the_content(); echo $content;?>
bunun harici content üzerinde sadece br taglarının kalması için fonksiyon dosyanıza ekleyin;
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
add_filter( 'the_content', 'nl2br' );
add_filter( 'the_excerpt', 'nl2br' );
functions.php Kodu
function be_attachment_field_credit( $form_fields, $post ) {
$form_fields['anlat'] = array(
'label' => 'Anlat',
'input' => 'text',
'value' => get_post_meta( $post->ID, 'anla', true ),
);
return $form_fields;
}
add_filter( 'attachment_fields_to_edit', 'be_attachment_field_credit', 10, 2 );
function be_attachment_field_credit_save( $post, $attachment ) {
if( isset( $attachment['anlat'] ) )
update_post_meta( $post['ID'], 'anla', $attachment['anlat'] );
return $post;
}
add_filter( 'attachment_fields_to_save', 'be_attachment_field_credit_save', 10, 2 );attacment.php Kodu
<?php echo get_post_meta($post->ID, 'anla', true); ?>
Meta Kodu
<meta name="description" content="<?php echo substr(get_post_meta($post->ID, 'anla', true),0,160) . "..."; ?>" />