Skip Navigation

[Resolved] Load data CPT from functions[dot]php

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 1 year, 10 months ago.

Assisted by: Minesh.

Author
Posts
#2540651

Hi,
I have a CPT named "test."
In my CPT "test" I have a "macro category" and "micro category" field. How can I, from functions.php create a query that will export me all the posts of a given macro category and/or micro category?

Also from functions.php is it possible to export all the items in a drop-down menu (example macro category)? Not of the individual post item but of the menu in general.

Regards

#2541011

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no such feature a available with Toolset so that you can export the posts from functions.php file.

Here is how you can query posts based on specific taxonomy with WP_Query:
=> https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters

You will have to write your own custom code that should fulfill your requirement or you should find number of plugins available that should help you to export your desired content.

Here are few plugins that might help you:
- https://wordpress.org/plugins/wp-ultimate-exporter

Please check method 2 with the following article:
- hidden link

Following articles may help you as well:
- hidden link

If you require any help with such custom code - you are welcome to contact any of our certified partners:
- https://toolset.com/contractors/