Forum

Thread tagged as: Question, Blog

Strip p tags from perch_blog_post_field function

Hey guys,

I'm using the perch_blog_post_field function to provide a description in the head of my blog post page.

Can I strip the p tags from the output without editing my post.html template?

<?php perch_blog_post_field(perch_get('s'), 'postDescHTML'); ?>

Elliot

Elliot Davies

Elliot Davies 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

<?php echo strip_tags(perch_blog_post_field(perch_get('s'), 'postDescHTML', true)); ?>

Thanks Drew, I wasn't completely sure how to use strip_tags, much appreciated.