Recent Posts Element showing incorrect Content

Hi Team,

i have added a recent-posts element on the start page.
i want to achieve the following:

3 Preview posts with Images of Category A
List of Posts of all categories beside excluding the last 3 Posts of Category A

URL and Access provided in Secret note.

Between post 1st and 2nd i am missing one post from Category A from 25. November…

Please help me with that issue.
Regards
Patrick

Hi there,

Thanks for writing in.

It seems to be correct, plus, you only have few posts and Nov 25 is not one of them. Could you double check again if it’s the correct site?

Thanks!

Hi,
i have about 20 Posts in category “einsatzberichte” . Links provided in Secure Note.

normally, the categories are mixing or is the “recent posts” not taking custom category types?

If i change the Recent Posts Widget Category to only 1, it is showing only this category, if i change it to 2 Categories, it is showing the last what i enter in the field and not showing all of the given categories

Regards
Patrick

Hello There,

Thanks for updating in!

Please keep in mind that recent post elements will only display posts and portfolio items.

You are referring to a custom post type “Einsatzberichte” which will not be displayed in the recent post element. If you want to include this in the element, you will need a custom code. Since the child theme is set up, please add the following code in your child theme’s functions.php file

// Add einsatz type to recent posts element
// =============================================================================
function add_einsatz_post_type( $types ) {
  $types['einsatz'] = 'einsatz';
  return $types;
}
add_filter( 'cs_recent_posts_post_types', 'add_einsatz_post_type' );
// =============================================================================

And then after that, please edit the page again and in your recent post element, select “Einsatz” as the post type.

Hope this helps.

Hi!

Thanks, that worked fine!

so is it not possible to show different post types under “posts”?
Because when I check “Post Type: posts” and then enter “Category: einsatzberichte” it is also working. But when i then mix this with the “standard posts” it is displaying it wrong.

But anyway: thanks -> got it working! :slight_smile:
Patrick

Hi there,

You can select one post type at a time in the Recent Posts element and unfortunately, you can not select multiple post types.

Thank you.

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