Archived topic
Mixing custom post types and std post types is distorting archive page layout
5 replies · Started by Paweł on March 11, 2023
When I include both standard post type and any custom post type in any single archive page the page layout gets distorted. The sidebar is empty and sidebar elements like widgets are moved to the bottom. This does not happen if I use only standard post type or only custom post types.
I found out also that after removing line do_action( 'generate_after_main_content' ); from archive page the problem is solved, however, there are other layout options missing like column view.
Did someone face similar issue or do we have more information about generate_after_main_content and which elements are using this hook ?
Hi there,
Can you link us to the archive where we can see the issue?
This is a small development env I made offline - no online version available.
Lucky enough I managed to find some clues. The main issue was somehow related to the posts I imported directly into WP. Just a simple import from another website. When I deleted them the layout got better - everything was correct except column view - it got disabled. I managed to find a workaround by adding filter on the generate_blog_columns in functions.php file. Not sure if that's the right way, but it worked for me.
I managed to find a workaround by adding filter on the generate_blog_columns in functions.php file.
This sounds about right :) Just make sure the functions.php file is the one in the child theme, not the one in GP theme.
Yes it is.
Marking as resolved
Glad to hear that :)