We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, Docs, Blog

Documentation: Perch Blog: Page Functions: perch_blog_post

I believe the documentation for perch_blog_post leads users down the wrong path.

For example, when I added the following to my page:

<?php perch_blog_post(perch_get('2014-06-09-elston-avenue-mural-project')); ?>

Nothing rendered on the page. <?php PerchUtil::output_debug(); ?> reported this:

SELECT p.* FROM perch2_blog_posts p WHERE postStatus='Published' AND postDateTime<='2014-08-14 20:01:00' AND postSlug=''

But when I added only the blog slug as the argument as follows:

<?php perch_blog_post('2014-06-09-elston-avenue-mural-project'); ?>

The page rendered the correct blog with the post.html template.

Thanks for listening.

Joseph Murphy

Joseph Murphy 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

perch_get is to get the value off the querystring which is what people generally want to do. As the documentation states,

"The above will use the value of ?s= on the URL to find the blog post."

I'm not sure why you want to hardcode a value, but you can do that - but yes just pass in the string in that scenario.