WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sumakagawa
    Member
    Posted 1 year ago #

    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/

  2. chavo
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic