CPT with cloud template not showing in categories page (archive)

Posted in: Newspaper
Post count: 3

Hi everyone,

I am using the newspaper theme 11.5.1 where cloud templates start supporting CPT/Taxonomies.

The custom post type, called ‘kurs’, has ‘has_archive’ enabled and is added to the ‘pre_get_posts’ hook, see for reference:
function custom_post_type_cat_filter($query) {
if ( !is_admin() && $query->is_main_query() ) {
if ($query->is_category()) {
$query->set( 'post_type', array( 'post', 'kurs' ) );
}
}
}

add_action('pre_get_posts','custom_post_type_cat_filter');

I am not sure which extra steps are needed when cloud templates are in play and whether the theme itself selects fitting posts for category pages based on the template file taxonomy…any advice here?

Post count: 21065

Hello!

Can you please provide more information about the issue or what are you trying to achieve?

A solution for sending a screenshot/video is this:
Download, capture, send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link, paste it here.

Read all about CPT support here: https://forum.tagdiv.com/custom-post-type-support/

Thank you!

Post count: 3

Hi Bettina,

I’ve added an extensive explanation covering:
– how we added the custom post type including an excerpt of the functions.php customization
– short explanation on the cloud template being used
– 1 example of custom post type & category page, their URLs are:
a) category page: https://aktiennews24.de/thema/einzelaktien/nordex-aktie/
b) custom post: https://aktiennews24.de/news/kurs/nordex-aktie-30052022/
– the configs that we have in the theme panel

We appreciate you looking at the video recorded:
https://www.screencast.com/t/ico9Q8ue
-> I checked the audio quality and it should be good

Post count: 21065

Hello!

I can see that you use also default templates. I recommend you to use only cloud templates, also for your category page, so you can edit it with the TagDiv Composer and use the shortcodes/elements in order to display what you need.

Thank you!

Post count: 3

Hi Bettina,

thanks for getting back. A few follow up questions and answers:
– “I can see that you use also default templates.”
-> Yes, for the category pages at least, so far. Is that a problem?

– “I recommend you to use only cloud templates, also for your category page.”
-> How would that change things? The default category template is perfectly able to list standard post types.

What I am trying to communicate is that shortcodes/elements seem to fail to list/show our custom post type with the way that things are configured.

Post count: 21065

Hello!

It is not a big issue, but try with cloud category template, so it might work.
If your CPT are not working, then the problem it could be from your code.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.