Enter fields content in csv to be displayed in Content and Excerpt


First, I think that the issue presented in this post is for Advanced php/wp experts. I am not one of those :slight_frown:

I have the following wp fields: url, post_title, category, email, etc
I also have Custom fields: Key_1, Key_2, Key_3, Key_4

Now, I would like to edit my csv to display within the results of post_content the contents of Key_1, Key_2, url, post_title, or whatever field I like.

For instance, a post_content or post_excerpt cell in my csv file will look similar to this:
"Thank you for visiting (post_title). The offices of (post_title) are located in (Key_1) close to (Key_2). The website of (post_title) is the following: (url). Should you need to contact (post_title) by phone please dial (Key_3)."
This is just an example but imaging what limitless alternatives you could employ to create complex directories, with all sort of contents, making directory sites sweet for search engines.

What I want is to populate the contents of aforementioned fields within post_content & post_excerpt.

Is this possible?

If yes, what would be the code that I would need to write within post_content & post_excerpt fields in my excel csv cells?

Thanks in advance.

  • cbriere

    Hi Phil,

    You are right! I am using a theme called DirectoryPress (http://www.premiumpress.com/directoryscript/)

    Said theme has a tool that allows me to easily import all posts with its corresponding fields, including custom fields.

    What I did is create a .csv file in Excel and then import all posts with its corresponding fields and custom fields, using aforementioned theme's tool.

    However, now I would like to do what I explained at the start of this thread. The problem is that I don't know what code I have to include in the .csv cells so that WP can later display the contents of all those fields.

    Thanks again for your reply.

    Please help.

  • cbriere

    Hi Phil,
    Thanks for the reply.

    The documentation does not provide for the issue at bar.

    What I need is some kind of plugin able to read the contents of all the header and rows of a .csv file, and at the same time capable to import some kind of code that makes reference to the fields (regular and custom) so that it could be read by WP and displayed within the posts.

    I have looked lots of plugins out there but none seems to do what I need. How come? The last resort: "its impossible!?

    It seems like it's impossible to insert in a .csv cell the following and later be read by WP:
    "Thank you for visiting (post_title). The offices of (post_title) are located in (Key_1) close to (Key_2). The website of (post_title) is the following: (url). Should you need to contact (post_title) by phone please dial (Key_3)."
    Phil, are WPMUDEV working on something like this? May I request this plugin be created?

    I need this since (and the whole community will appreciate it) since we create lots of directories and it would be VERY helpful to display field contents in the structured way I suggested. Also it will be VERY helpful with search engines (this is sweet for Google). I know of a site that already did what I need, but I just can't figure out how they did it. For instance, please check: http://www.medicospr.com


    @ bidonroad: Thanks for the input. However, I have no problems importing. The problem I have is THE WAY I want to do it as described at the start of this thread. Thanks.