I am new in using Wordpress, I created a page that contains a long list of items.
* Item 1
* Item 2
* Item 3
* Item 4 ... and so on
I am planning to embed this page with long list of items on a separate page. How am I going to do it?
I followed tutorials online and got the idea of putting this piece of code add_post_type_support( 'page', 'excerpt' );
on functions.php
. After putting the code, an new option will be available when you create/edit pages. But after that, how can I display the my page excerpt?
First to put this code on your theme function.php file.
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
After that enable excerpt for page see below define image:
Using this code to get page excerpt:
<?php echo get_the_excerpt(); ?>
<?php
query_posts("page_id=36");
while ( have_posts() ) : the_post()
?>
<h1><a href="<?php echo the_permalink(); ?>"><?php echo get_the_title(); ?></a></h1>
<?php the_excerpt(); ?>
<?php
endwhile;
wp_reset_query();
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With