-
AuthorPosts
-
January 28, 2016 at 6:27 pm #573941
Hello,
I hope you can help me with a couple of questions. I have created a few custom post types and taxonomies while playing with an experimental site and am simply trying to sort out the structure before thinking about anything else.I created a custom post type (let’s say it was called ‘bakers’) with a simple plugin.
I then added a two taxonomies for this cpt called ‘counties’ and ‘area’ via functions.php.
One contains a list of UK counties, the other a list of postcode areas.
I created a batch of custom post fields via the ACF plugin, linked to the ‘bakers’ post type.I created a renamed single.php in my child theme, called it single-bakers.php and found the relevant code for functions.php so that it shows the correct post title (‘Billy’s Bread’ instead of ‘blog’). That’s fine.
However, what I also need to do is create customised archive pages to display listings of the above single custom posts.
One archive page, for example, will be “London” and this should include all listings with this taxonomy. And so on.I assume this is output via a standard archive page and so all I have to do is clone and edit one of the standard php files, but am not sure. Which one do I need to customise? Secondly, what code would I need to add to functions in order to get these archive pages to show the correct name?
Many thanks for any help.
January 28, 2016 at 8:16 pm #574035Hi brian7454!
It is amazing when ppl do get a theme and then customise it so much.
I am sure you will enjoy working with enfold.Take a look here:
and you will understand more on how to create it.
Best regards,
BasilisJanuary 28, 2016 at 8:38 pm #574062Um…all I can see above is an empty grey box?
However, the link you posted showed up in the notification email. However it doesn’t help at all.
I’ve found various ‘help’ articles online, none of which have been helpful because what they say to do and change doesn’t relate to what I see in Enfold files… that’s why I was asking for pointers here!- This reply was modified 8 years, 10 months ago by brian7454.
January 30, 2016 at 7:18 pm #575060Anybody?
I’ve managed to get single.php customised now, but I can’t find anything with useful help online regarding archive pages (most just say things like ‘find and edit this page…’ without actually saying how…).February 3, 2016 at 6:08 am #576885Hey!
Please check the template hierarchy documentation for custom taxonomies and custom post types: https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-taxonomies
Best regards,
IsmaelFebruary 3, 2016 at 8:26 am #576950Brilliant, more help from the Enfold help team that is actually no better than saying ‘we can’t be arsed to tell you’.
Excellent work guys.I suppose next you’ll be telling people who ask how to change the colour of a menu that this is customisation, which support doesn’t deal with, and to refer instead to the wordpress codex.
Waste of space.
February 3, 2016 at 11:31 am #577050Hey!
I think you’d better off creating the archive pages with the Advanced Layout Builder, that way you’d have full control of the layout and you wouldn’t need to mess with PHP code.
Once you have these custom archive pages you can use this plugin to create a redirection from the default archive page to the custom one, for example:
/tag/some-tag -> /my-custom-tag-page
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.