• Dear WordPress users and professionals,

    Currently I am working on a website, which is being powered by information that comes from multiple datafiles (around 20). They are currently Excel.

    Now I want to use this for my custom post types, so I’d like to have certain data from certain files imported all into a certain custom post type.

    Is there any way I can import the data (as the files) into WordPress without making the custom post types yet and then somehow call on this data?

    I have tried Wp All Import, but that always makes (custom)posts or pages, but can’t add thesame data to multiple custom post types for example.

    Hope I’m clear and hope you guys can help me out here!

Viewing 5 replies - 1 through 5 (of 5 total)
  • You have to define your data structure before you can implement it.
    Your custom post type can be a “post” in the standard post table, but also have meta fields that are pointers into other data tables. You would need to write the code to create and retrieve from the new tables in relation to your custom post.
    Custom post types can be anything, but the emphasis is on the “Custom” part: you have to write code for what you want.

    Thread Starter Klaas Koopman

    (@inspired-media)

    Hi Joy, thank you for your reply.

    What exactly do you mean about defining my data structure?

    I mean what part of the data would reside in the post itself and what part needs to be in separate table(s), using some data as relationship, such as ID or date or whatever, so that the data is not duplicated and it can be retrieved when needed for display.
    You can’t import data unless you know where it needs to go, and for that you need to define how the pieces relate to the whole.

    Thread Starter Klaas Koopman

    (@inspired-media)

    Joy I think I thought of something different;
    To import the files into a database and collect the info from that database into the custom posts (perhaps through theme files for those custom posts?)

    Because I tried to import into custom post types, but that didn’t work, because I have certain data that needs to be added to multiple custom post types.

    Moderator bcworkz

    (@bcworkz)

    Could you break the data into discrete parts and make multiple imports, one for each type? If not, you need a custom import script that would know which post type corresponds to each bit of data. If a custom script is required, CSV data is much easier to parse than a native Excel file. Alternately, I imagine there is some sort of library module you could utilize to directly parse Excel files.

    Your different idea is viable, but you’s still need a custom script to parse the import data into the corresponding post types. I’d think breaking the source data into parts which are imported separately is the easiest to achieve, but I do not know the nature of your data.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Data from multiple files into custom post types?’ is closed to new replies.