• Resolved wiitguru

    (@wiitguru)


    Dear Pods,

    I would like to add a 524-item list to my WordPress site for users to be able to select from in a dropdown. Currently, the list is saved as a CSV on my computer.

    I am thinking that the best way to save the list to my site is as a taxonomy, but I am not sure. Also, the list will need additions/removals to it by admins, so it must be dynamic.

    The list is a list of freshwater fish families. Users will select from the list to be able to categorize a Post that they will be making.

    Are taxonomies the best way to go about this? Is it possible to import the CSV list?

    Any help is appreciated. Thanks!

    Brian

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • PODS does not import content; it only imports “build” (i.e., POD structure) information, but does export both content and build information. The build (only) import/export occurs as JSON code, while content export is available in four file types, including .csv and JSON.

    Third-party plugins/methods are required to accomplish content import, such as the WP All Import plugin series, which imports .csv or JSON (and other) file types.


    There are also several CSV-to-JSON converters available online (or JSON-to-CSV), in case you want to maintain both content and build information in one file format; just perform a search to find them.

    Incidentally, your URL link does not seem to resolve as a webpage.

    Plugin Support Paul Clark

    (@pdclark)

    Here is a function I use that might be useful in your endeavor:

    <?php
    /**
     * Return a term_id, creating the term from $title in $taxonomy if none exists.
     *
     * @author ??δ??? <[email protected]>
     */
    function maybe_create_taxonomy_term( $title, $taxonomy ) {
    	$term_id = term_exists( $title, $taxonomy );
    	if ( is_array( $term_id ) ) {
    		$term_id = $term_id['term_id'];
    	}
    	if ( empty( $term_id ) ) {
    		$term_arr = wp_insert_term( $title, $taxonomy );
    		$term_id = $term_arr['term_id'];
    	}
    
    	return $term_id;
    }

    It would be used in a plugin which calls fgetcsv() (see examples on the docs page). An appropriate place to use it might be WP_CLI::add_command() or wp_ajax_{your-action}. The first is not prone to timeout errors.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pods – Custom 500+ entry list’ is closed to new replies.