Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
get_page_excerpt() not working
#1
I am building a test site and am having trouble getting get_page_excerpt(250, $file) to work. there are no errors in development tools, debug, errorlog, or on screen.

<section>
<a href="<?php echo $file; ?>" <- this works
<h2><?php echo $page; ?></h2> <-this works
</a><?php get_page_excerpt(250,$file);<- this doesn't work
//getPageContent($file); ?> <- this works
<p><a href="<?php echo $file; ?>">Read More...</a><- this works
</p>
</section>

Any suggestions?
Reply
#2
What is $file?
Reply
#3
This function does not expect $file
Reply
#4
get_page_excerpt() displays an excerpt of the current page. It doesn't work for other pages, since there's no parameter to specify another page slug.

This may work for page with slug $slug :

Code:
<?php echo getExcerpt(returnPageContent($slug), 250); ?>
Reply
#5
(2018-05-20, 16:33:23)Carlos Wrote: get_page_excerpt() displays an excerpt of the current page. It doesn't work for other pages, since there's no parameter to specify another page slug.

This may work for page with slug $slug :

Code:
<?php echo getExcerpt(returnPageContent($slug), 250); ?>

Thanks I will try this!
Reply




Users browsing this thread: 1 Guest(s)