Forum
Blog post types
Hi there,
Just updated an old blog to P3 and imported into the new site I'm making for it. There are three post types - which show up - and when I go to add to a post-type it's not actually setting the post correctly as when I try filter posts by category or section they don't appear under anything, they will only appear under 'posts'.
The imported data filters down as I would expect, with the correctly set post type. I can't workout what's causing it not to set the post type. I can see in the debug that the correct post type template is being used. Nothing else in the debug points towards any visible errors.
Could you give some steps to reproduce the issue? I don't quite follow your description.
Apologies, I'll try be clearer.
So I have a Perch 3 Runway site locally I'm developing and I've imported the blog from the old site which was running the previous version of Perch. The posts have all imported without a problem.
I have sections and categories as well as post types. Now at the moment the problem is, if I try to add a new post to one of the three post types, it doesn't appear to be adding itself to that particular post-type. For instance, if I add a post to 'Workout Diary' and I go to the workout page where I have the function pulling those posts out:
I don't see anything other than my imported posts. And additionally when I try sorting on the posts page in the admin, the post isn't appearing under sort-by sections, it seems to only be there if I click on 'blog' rather than by section or category.
Is "workout diary" a section or a post type? You seem to be conflating the two.
It's actually both - I set the original site up when I was quite new to Perch and I'm not sure why I set it up like this, but it's actually a section and a post type.
Ok, so is the issue with sections, or with the post type?
I've just adjusted the code above and I think the section is the problem. If I change
'section' => 'workout-diary',
to'section' => 'news'
the post still isn't appearing. So it's not going into any section. Only if I remove the section argument do I see my test post.Drew, and I correct in that I should be getting a dropdown on the post itself to select a section, as it has been in older versions of the blog addon?
Yes, you should be able to choose the section.
Oddly, the sections dropdown isn't appearing on any of the post types
In the meta tab?
Whoops... moved here from incorrect thread.
Sorry Drew, I missed that initially.
I've done some testing, posting to both sections - news and workout diary.
My workout diary section gets posts absolutely fine but posting anything to my news section doesn't appear to be working. The news section itself has two categories within it, which is the only difference between news and workout diary. The categories are articles and athlete spotlight.
I pull these posts directly onto the news page via:
Even if I remove the category part, the post isn't appearing. I've triple checked and these test posts I am trying are definitely set to the news section.
What does debug output?
I just noticed a method for getting it to show, which seems like it could perhaps be a bug, or maybe a problem with my setup.
If I add a new post, assigned to articles category within the news section, set to published - it will not show up unless I save, go to meta and hit save under meta, then go back to the post screen and hit save one more time, then it appears on the front-end.
Do you make any changes at that point, or just resave?
Just re-saved
Hmm, that sounds like something I need to look into.
Ok, thanks Drew!
Hi Drew,
Just a small update to this. I've noticed some other strange behavior on the blog — linked to this. If I go into make any edits to posts within one of my categories, save again, the post then vanishes from the listing but this time getting it to re-reappear is a lot harder than just a few saves.
And lastly, this could be separate but I noticed new posts are not picking up the image, despite being uploaded to a blog content field called
image
- they are instead being mapped to an id ofperch_image
which is no where in my templates. I don't if the image problem warrants a new thread?Every ID gets prefixed internally and in the templates, but they're duplicates. It doesn't sound like the same problem at all, so you should post a new thread so I can keep track.