Support » Plugin: Custom Field Template » [Plugin: Custom Field Template] how to make fields to excerpt?

  • sumakagawa

    (@sumakagawa)


    how to make fields to excerpt(show to frontpage)
    like….
    fields….
    -author : arie (no excerpt)
    -source : link (no excerpt)
    -overview : content overview (this 100 word of excerpt)
    -fields4 (no excerpt)
    -fields5 (no excerpt)
    -post content form(no excerpt)
    only one to excerpt ,(overview fields)..
    how make this…
    thank advanced …

    http://wordpress.org/extend/plugins/custom-field-template/

Viewing 1 replies (of 1 total)
  • Hi. Did you find a solution for this problem?

    I guess you can filter the field with this code.

    In functions.php

    <?php
    function limit_words($string, $word_limit) {
    $newstring = substr($string, 0, $word_limit);
    if(strlen($newstring) < strlen($string))
        $newstring = $newstring."...";
    echo "<p>".$newstring."</p>";
    }
    ?>

    Then, in your theme, you can put something like this:

    <?php $excerpt = get_post_meta($post->ID, 'overview', $single=true); limit_words($excerpt,100); ?>

    I don’t test it, but I think it will work.

    ps: sorry for my english.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Custom Field Template] how to make fields to excerpt?’ is closed to new replies.