Meta box in CPT archives
-
Hi,
In CPT archive settings screen, there’s no meta box for SEO settings to add a custom title and a custom meta description.
CPT’s were created with Types.
Thanks,
Thomas
-
Hi Thomas,
The Metabox requires both the Editor (content) and Title to be available and supported on the CPT.
I’m not sure what the Types plugin is, could you link me to it? Then I can take a look as well and give a more informed answer :).
If the Types plugin has options for the CPT to add Title and Editor support, be sure to enable these, that should solve it.I hope this helps!
Hi Sybre,
Sorry for my late reply and thanks for yours.
Type is a plugin by Toolset to easily create Custom Post Types and Custom Taxonomies : https://wp-types.com/
Types already supports Title and Editor for the CPT’s concerned. What is strange is in a CPT archive screen, the SEO option is selected in the Screen Options but the box itself isn’t visible.
For the taxonomies created with Types it’s fine though.
Hi Thomas,
The column in the screen settings is there because of a bug (which is fixed in the next version).
Other than that, do you require the SEO box to be available?
If so, I’ll need the CPT slug and fill it in this filter below:add_filter( 'the_seo_framework_supported_post_types', 'my_custom_post_type' ); function my_custom_post_type( $args = array() ) { $args[] = 'my_post_type'; $args[] = 'my_other_post_type'; return $args; }I hope this helps! 🙂
What do you mean by “do you require the SEO box to be available ?” ?
I’ve added this filter to the functions.php but the SEO box is still not visible.
Hi Thomas,
The question means: Do you want the SEO Box on that page, as the archive doesn’t seem to be made for these kinds of custom settings.
Could you send me a screenshot of the CPT archive admin page and the settings used to create them? It’s quite hard for me to figure out how to handle this as it’s a premium plugin we’re dealing with.
But in the end, the CPT archive isn’t meant to be supported by The SEO Framework. A related solution is found here.
Let me know if it all works out! 🙂
Hi Sybre,
Great solution thanks!
It’s quite a long piece of code because I’ve 6 different CPT’s and 2 languages but it’s working well.
By chance, the CPT archive would be supported by your plugin in the near future?
Hi Thomas,
I’m glad to see it’s working out for you :).
I just took an extensive look at various CPT Archive settings pages and they all have a different approach with very specific keys to create the page (which can’t be found or identified automatically through WordPress globals).
I think I should make a small API so other developers can hook the SEO Settings within their code. When and how is still something I have to think about.
I hope this clears things up! Have a wonderful day Thomas :).
The topic ‘Meta box in CPT archives’ is closed to new replies.