Skip Navigation

[Gelöst] Integrating Content Templates or Layouts with Stockholm theme

This support ticket is created vor 6 Jahre, 6 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 Antworten, has 2 Stimmen.

Last updated by daveG-7 vor 6 Jahre, 6 Monate.

Assisted by: Luo Yang.

Author
Artikel
#571952

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.

#571973

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

#572255

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

#572366

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

#573356

That worked. Thanks for your help.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.