Site logo

Archived topic

Customizing post type archives - removing the sidebar and adding extra elements

3 replies · Started by Filip on April 22, 2022

Viewing posts 1–4 of 4

Hi,

Following your tutorial, I've created a custom post type for the case studies that's identical to my blog post singles and archives (design-wise).

Here's the link.

However, I want to remove a sidebar that shows recent posts and categories and show the date/author underneath the title, just like in the blog archives.

Please help.

Thanks,

Filip

Hi there,

for the sidebar, you can use a Layout Elmement to disable the sidebar for your Post Type Archives:

https://docs.generatepress.com/article/layout-element-overview/

To add the post meta add this PHP Snippet to your site to enable Meta for that post type:

add_filter( 'generate_entry_meta_post_types', function( $types ) {
    $types[] = 'my-post-type';

    return $types;
} );

Just replace the my-post-type with yours

Works fine.

Thanks a lot, David!

Glad to hear that!

This archived topic is closed to new replies.