Site logo

Archived topic

Console Error on CPT when I use these Snippets

9 replies · Started by melvin on June 3, 2021

Viewing posts 1–10 of 10

Hi,

I've use these 2 Codes to activate MY CPT Archive layout following GP blog in customizer



	// Project CPT, Project Tax - Content Column Setting
	add_filter( 'generate_blog_get_column_count','ke_column_count_project_archive' );
	function ke_column_count_project_archive( $count ) {
		if ( is_post_type_archive('projects') || is_tax( array( 'project_status', 'project_region', 'project_type', )) ) {
			return 50;
		}

		return $count;
	};

	// Project CPT, Project Tax - activate masonry (if not column not working)
	add_filter( 'generate_blog_masonry','ke_projects_masonry_project_archive' );
	function ke_projects_masonry_project_archive( $masonry ) {
		if ( is_post_type_archive( 'projects' ) || is_tax( array( 'project_status', 'project_region', 'project_type' ) ) ) {
			return 'true';
		}

		return $masonry;
	};

After implementation of code, it comes with a console error as this https://imgur.com/a/L3bVNaJ

May i know how to fix it?

Thanks

Hi there,

in the Block Element do you have the Keep default post container enabled ?

I have been trying to replicate the problem locally but have not been able to.
I just checked your original URL ... and it looks like you chosen a different layout. Let me know.

and it looks like you chosen a different layout

May I Know whats that mean David?

Although the code still works - it looks like a bug in the script. We'll get this patched asap, but for the time being you should be able to ignore the error.

Hi David,

Thanks for the feedback. So after you get this patched on next theme update the error will be gone right?

Thats correct.

Perfect

Thanks David 😁

Thanks for letting us know!

This archived topic is closed to new replies.