wordpress get excerpt by id -


i'm using options framework

and can't work out why doesnt work

$x = of_get_option('post_number'); $content_post = get_post($x); echo $content_post->post_excerpt; 

its odd because

echo of_get_option('post_number'); 

works , outputs number

and according get_post code should work yet echo produces nothing, not error message

so must handeling get_post() incorrectly somehow, clues?


edit

var dump http://pastebin.com/zegq5wpn reveals post_content full post_excerpt empty

how regenerate excerpt?


edit [resolved]

i decided manualy overwrite excerpt option missing, found this

and used

add_post_type_support( 'page', 'excerpt' ); 

to manualy write excerpt

$text = apply_filters('the_excerpt', get_post_field('post_excerpt', $post_id)); 

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -