WordPress.org

Support

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

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

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.