I'm having trouble using the Stockholm theme with content templates and layouts. It uses the_content only for a small part of the actual content, where the text from the content editor would go. You can see an example here: hidden link - I'm using a content template for this custom post type, Cocktail Recipes, that inserts the text "I’m a test cocktail template" which you can see shows up way down at the bottom, under the date and the title. I'd like to use the content template to control everything below the header with the logo and menu, ideally. I could also use a layout for the same thing - but layouts assigned to Cocktail Recipes show up in the same place, where "I'm a test cocktail template" is currently. Any ideas how to better integrate this theme so I can control the appearance of my custom post types? I've seen this thread: https://toolset.com/forums/topic/troubles-integrating-with-theme-stockholm-by-select/ but don't think that solution is what I'm looking for.
Dear Dave,
It depends on your theme file, in your case, I suggest you copy the theme file "single.php" to file "single-cocktail-recipe.php",
edit the new file "single-cocktail-recipe.php", find the codes you want to control:
everything below the header with the logo and menu
Replace it with wordpress function the_content();
https://developer.wordpress.org/reference/functions/the_content/
If you need assistance for it, please provide a downloadable URL for the theme "Stockholm", I need to test and debug it in my localhost, thanks
Thanks. I don't know a ton of PHP, but I think that should be enough for me to muddle through to get where I want 🙂 However, I'll also need to do archives. What's the file name format for a custom post type's archive template? archive-cocktail-recipe.php? archive-cocktail-recipes.php? Something else? Same question for categories. Do you have documentation for creating these templates in general anywhere?
Thank you,
Dave
Yes, it should be archive-cocktail-recipe.php, see wordpress document:
https://developer.wordpress.org/themes/basics/template-hierarchy/#custom-post-types
Custom Post Types use the following path to render the appropriate archive index page.
archive-{post_type}.php – If the post type is product, WordPress will look for archive-product.php.
archive.php
index.php
That worked. Thanks for your help.