Read more not working on pages
-
Hi there,
I am having trouble getting only an excerpt of a page to display on the home page. I am using the following code to pull through the page data and title etc.
<h2 class="entry-title"> <?php $page_id = 2; $page_data = get_page( $page_id ); $title = $page_data->post_title; echo $page_data->post_title; ?> </h2> <?php $page_id = 2; $page_data = get_page( $page_id ); $content = $page_data->post_content; echo $page_data->post_content; ?>
The page that the information is being pulled from has a <!–more–> tag on it so that only a sentence is displayed on the home page. However, all of the information on the page is still being pulled through.
Is this the right way to achieve this?
Thanks in advance,
Phillustration
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Read more not working on pages’ is closed to new replies.