ACF, Cornerstone Photography Gallery

Hello,

I’m writing this post after being in touch with One support and getting slow, short and ultimately unhelpful replies, even when I try to explain what I’m doing. I’m outlining everything here as clear as I can. I am happy to have this discussion within the One portal if you require.

Firstly, I have setup a custom post type called Gallery and a taxonomy called Country. These two will use the same layout you see below, if thats possible (please advise).

Under Country you have Ireland, Spain and France etc

I understand nested loopers might be needed but when I tried doing it as per instructions in One the linked to /dublin which of course threw a 404 since it’s not following the custom post type structure of /gallery/ireland/dublin etc etc

I’d be really grateful for some clear and detailed steps to get this running.

Thanks a lot in advance

Hello Daniel,

Thanks for writing in! Based on the information above, WordPress will normally have these archive pages:

For the “Gallery” custom post-type archive:

For the “Country” taxonomy archive:

Having to merge the permalink to have /gallery/ireland/dublin will require modifying the permalinks. Be aware that what you are trying to do is beyond the scope of our support. We only cover getting your site, theme and plugins setup, minor cosmetic changes and bug fixes. What you need requires custom coding to modify the permalinks. Perhaps, this article can help you instead:

Best Regards.

OK, thanks for that. Modifying permalinks won’t be a problem and something I can do.

In terms of getting the layouts done within Pro would I have separate layouts for each? i.e. ``country archive, country single I already have one for Gallery as an archive layout but in terms of country and the various levels I need. And I’d need to have these set dynamically because the user may add more countries within ACF at a later date. Here’s a video for explain further:

Hello Daniel,

You are already on the right track. You just need the following steps to properly display the Countries and sub-countries.

Page Structure:
–> Galleries - Single page layout and would have the same archive layout for the “gallery” custom post type archive that will display the major or top countries

-------------> Ireland (or any country) will be using the custom Archive layout that displays the sub-countries

----------------------> Dublin (or any sub-country) will still use the same custom Archive layout above.

For the single page layout and the gallery custom post type archive layout, you need a Looper Provider Custom that will only display top or parent Countries. Perhaps this thread can help:

Before displaying the main loop that returns the gallery items in the country archive layout, there is a custom using the Looper Provider Custom that will display the Countries or sub-countries. A custom PHP code is needed to determine whether the country archive has sub countries or not. It will return sub countries based on this thread:

You may need a Pro child theme to do this or use the Snippet plugin to be able to insert the custom PHP code for the Looper Provider Custom.

Hope this makes sense.

So, all the layouts I need are Gallery Arhive and Gallery Single? No separate ones for country?
Screenshot 2024-07-22 at 19.26.21

Hello Daniel,

The Gallery Archive and the Country Archive can use the same “Gallery” layout especially if they have the same layout. If they do not share the same layout and out, then it is best to have separate archive layouts.

The Gallery Single layout will be used to display the Gallery custom post type single item.

Hope this makes sense.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.