Forums

get_the_excerpt doesn't work on archives page? (2 posts)

  1. esdali
    Member
    Posted 1 year ago #

    Pastebin Code

    'get_the_excerpt' works fine on all of my pages but the archives page, and I'm thinking it's because I copied some code from a tutorial that uses $wpdb, which mysql to display information, and that is what's throwing me off. Mainly because I don't really understand php, yet alone mysql.

    $theid->ID works on most things (like category, titles, and EVEN Thumbnails!) but not for the excerpt.

    What is going on?

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    unlke some of the other functions, get_the_excerpt() dows not take the post ID as a parameter - http://codex.wordpress.org/Function_Reference/get_the_excerpt

    you need to create your own excerpt from the post content; possibly by programming a function using elements of what is used in wp_trim_excerpt() which you can find in /wp-includes/formatting.php about line 2023

Topic Closed

This topic has been closed to new replies.

About this Topic