Custom Field Template
how to make fields to excerpt? (2 posts)

  1. sumakagawa
    Posted 4 years ago #

    how to make fields to excerpt(show to frontpage)
    -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 …


  2. chavo
    Posted 3 years ago #

    Hi. Did you find a solution for this problem?

    I guess you can filter the field with this code.

    In functions.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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Field Template
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic