Forum
Using a Gallery Album in a Blog post type
I have a standard blog post type called 'Default' and I'm now building another one called 'Photo Essay', which will be images only. What is the best way to pull in a gallery album for that Post Type only?
Can I use a slug from index.php (depending on what post was chosen) to select a particular post type?
This thread specifies close to what I'd like to do, the difference being, I need a way for post.php to know which post type is displaying. https://forum.grabaperch.com/forum/09-01-2014-adding-gallery-album-to-blog-post?page=1
Are you using the albumlist field type?
I am, yes. Currently photoessay.html (a new blog post type file) contains
Which is fine. The issue is how (blog) post.php deals with this because unless this is still in place:
...all my standard blog posts won't display when selected.
As the other thread says, using this code works just fine to pull the gallery in:
So my challenge is how post.php knows what type of blog post type it should be showing (standard / with a gallery album / etc.). I understand what needs to change, where, just not...how! Thanks.
What does this output?
It just outputs "post.html" in text on the page.
Ok, great.
Hmm, so now I change the post type in the CMS, I select a gallery, save, no problem. The entire process is fine except it outputs a blank page for photoessay.html. However, post.html displays fine.
My bad. I hadn't altered the path to the alternative post types. So this is the working code:
Thanks so much Drew!