Forum
Republishing blog posts
Is there some way to republish blog posts after updating the post.html template? Like you can for page content regions.
I added a checkbox to an existing clients blog template to allow them to pin featured posts to the top of the blog listings, similar to this: https://forum.grabaperch.com/forum/11-20-2015-blog-featured-pinned-post … only problem is that every post has to be manually resaved for non-pinned posts to be displayed & there are hundreds!
Nothing is output from this, presumably because the newly added field I'm using to filter the result with (featured_post) is missing.
perch_blog_custom([
'template' => 'post_in_list.html',
'count' => 8,
'sort' => 'postDateTime',
'sort-order' => 'DESC',
'filter' => 'featured_post',
'match' => 'neq',
'value' => 1
]);
Thanks in advance!
Hi Adam,
If I remember correctly you can visit:
Thanks Mike, I see that has helped others in the past (where categories are concerned) but unfortunately doesn’t work in this case.
Try removing the row for
perch_blog_update
in theperch3_settings
table and run the update again.Thanks Drew, I just tried your suggestion but still no success.
I found a workaround to filter out the non-pinned posts by doing the filtering with if statements inside the post_in_list.html template, i.e.
Is there a republish function earmarked for a future blog app update & if not, would you please consider? Many thanks!
What happened? Did you see the update run through your posts 10 at a time?
Yes, it ran through the update 10 posts at a time as you'd expect, but the new featured_post checkbox field id wasn't added to the (unchecked) posts - verified by adding <perch:showall/> to the post_in_list.html loop. I thought it might be to do with the binary nature of the checkbox field type, so I tried it as a select type instead, removed the perch_blog_update entry form the perch3_settings table in the db & ran the update again, but no difference.
Ok. I would've expected that to work, but perhaps not. That's all a republish would do (that's what it's doing) so I'm not sure adding another republish option would help you.