WordPress.org

Ready to get started?Download WordPress

Forums

Is there an excerpt template? (3 posts)

  1. Pressnoob
    Member
    Posted 1 year ago #

    Okay I know it's a function but I want to know how to insert html into it. My goal is to have sort of an excerpt template up and running where I can modify the variables I want to through some custom fields.

    How is it possible to do this?

  2. Tammie Lister
    Member
    Posted 1 year ago #

    You can interact to a certain extent with http://codex.wordpress.org/Function_Reference/the_excerpt.

    The most common being:

    function new_excerpt_more($more) {
           global $post;
    	return ' <a href="'. get_permalink($post->ID) . '">Read the Rest...</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    You can though work out using that example how you could add a code wrap.

  3. Pressnoob
    Member
    Posted 1 year ago #

    That is what I found out but I was hoping there may be a better way because what if I have different excerpt templates for different kinds of posts?

    I'll try to figure out a way to make the custom fields into an excerpt (I know you can do this) , then using the TYPES plugin I could assign the custom field to a custom post.

    Thank you for answering and happy New Year!

Topic Closed

This topic has been closed to new replies.

About this Topic