Forum

Thread tagged as: Question, Blog

On the blogs how do I show the section a blog is from when using the perch_blog_...

I am outputting the blogs in a search and want to show the section name each blog is in. How do I do this? [sectionID] is returned in the array, but how do I used this to display the section title?

Martin Elliff

Martin Elliff 0 points

  • 6 years ago

Hi I have worked out I can do this for each result returned, but is that the only way?

$section = perch_blog_sections(array(
            'filter' => 'sectionID',
            'match' => 'eq',
            'value' => $search[$i]['sectionID'],
            'skip-template' => 'true'
            ));
print $section[0]['sectionTitle'];
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think that's the best way currently.