Tell us what you are trying to do?
I'm using a theme which needs me to add some code in order to be able to use their customizer settings to control the appearance of content archives. The theme gives this message:
"Enable Content Types
Archive content typesCustom post types must support "mai-archive-settings" to be available here."
I asked the theme's support what that meant and he said this:
>When you register a CPT in code, there is a parameter called "supports" where you put in an array of items like, [ 'title', 'editor', 'excerpt', 'mai-archive-settings', 'mai-single-settings' ]. I'd like to think Types has a field for adding in any custom supports elements. If not, you'll need to use code to filter the registered post type args, though at that point you might as well use code to register it too.
I understand that I could make an archive in your plugin but I really want to use the theme's customizer options because they are extensive.
Is there any documentation that you are following?
I've tried following your documentation but it's over my head.
Is there a similar example that we can see? Not that I can think of.
What is the link to your site?
hidden link
I'm not sure what you can see that will help but there it is.
I'm guessing I need to be in Settings>Custom Code? Can you tell me exactly what I need to do to accomplish what the theme dev told me I need to do?
Thank you!
Hi there,
Unfortunately, it is not possible to do that with Toolset, but WordPress has a custom function that you can change the parameters a post type.
Maybe it can help? I am not sure but worth the try:
add_filter('register_post_type_args', 'movies_to_films', 10, 2);
function movies_to_films($args, $post_type){
if ($post_type == 'property'){
var_dump($args['supports']);
}
return $args;
}
In the code above change 'property' with the slug of your post type. You can add the code to the theme functions.php or use this method:
https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
Now I just print the 'supports' parameter, what you would add to that is what the theme developer can help you with.
So you can share this with the theme developer.
If it is not working for you that way, then you will need to create the Post Type with another tool such as:
hidden link
Thanks.
Thank you so much for your quick and helpful reply!
I just wanted to give you a progress update. I sent this along to my theme developer and have asked him for feedback. He's also a quick and helpful replier so I have a plan to try. I'm hoping to get a chance to try it soon and will let you both know how it works out. I'm excited that it is going to work, just a matter of how many different tries it takes! Thanks again!
Thank you for the update 🙂