Importing Portfolio Items

Home Forums TurboCSV Support Importing Portfolio Items

This topic contains 9 replies, has 2 voices, and was last updated by  Chris 4 years, 1 month ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #12070

    LakesMarketing
    Participant

    Hi,

    I am using the template Cstar (ThemeForest) and the template has the following field options that turn the post into a portfolio item:

    – Featured Image Type = I want to use the option ‘link’

    – Link Type = I want to use the option ‘custom’

    – Custom Link = and this is where I put the url

     

    The problem I’m getting is how to map these fields to the fields I have in my import .csv

    Is this where the custom fields come in? If so, how do I find out what the name is of the custom field?

    I guessing this is a common problem or import job … I’m just struggling at how to map all the fields correctly. Any help would be much appreciated.

    Thanks

     

     

    #12071

    Chris
    Keymaster

    Hi,

    I can’t tell you what to set, since it depends on the theme, but those are probably custom fields.

    If the fields aren’t hidden you can see them just by checking ‘custom fields’ in the post editor.

    Often the fields are hidden (WordPress won’t show them if they start with an underscore “_”).  If so here are some ways to find the field names:

    – Ask the theme author

    – View the web page source in the post editor and try to find them there

    – Use a plugin – some plugins are available that can display hidden custom fields

    – Check your database tables.  Custom fields are stored in the ‘postmeta’ table.

    I hope that helps.

    #12073

    LakesMarketing
    Participant

    Great thank you – I will check.

    If I find out the name of these fields then it sounds like it is possible to import to them?

    Is this where I use the create a custom field option in the import page if the field is not in the list?

     

    Can I also ask – if the field is a drop down of options to select – would I need to create a column in the .csv with header as field name and the records to have:

    – value

    – or the value name

    #12074

    Chris
    Keymaster

    Hi,

    You’ll need a column for the field name you want to import.  In that column you’ll put the field values.

    The column name doesn’t have to match the custom field name, but if it does the plugin will default it a mapping for you.  If not, you can enter a mapping from the input column to the WordPress custom field in the TurboCSV import screen.

    Please see the TurboCSV documentation for some more info.

    There’s also a file called ‘sample2.csv’ (and sample2.xlsx in Excel format) in the plugin directory.  It has an example of a custom field column so it may be useful to take a look or try importing it.

    #12075

    LakesMarketing
    Participant

    Hi Chris,

    I’ve managed to find the field names quite easily by using Chrome’s ‘Inspect element’ feature. Thanks you for the suggestion.

    I’ve had a look at the sample.csv and read through the documentation again.

    I tried it again using the “!” at the beginning of the field name, for example:

    !_post_type

    and have added values as show in the html – in this case it is: list

    The three custom fields I’m trying to import:

    !_post_type

    !_post_link

    !_post_link_custom

    are not on the ‘Existing Custom Fields’ list and they are now missing from the ‘Create New Custom Field’ drop down list so I can’t select them.

    I suspect it is the “_” character at the beginning of the field name causing problems? Is this normal?

    Thanks

     

     

    #12076

    Chris
    Keymaster

    Hi, don’t put the “!” at the front of the custom field column name, e.g. “_post_type”.

    #12077

    LakesMarketing
    Participant

    Hi Chris,

    I’m afraid it didn’t work.

    It seems to have ignored the create new fields.

    Not sure what’s going on.

    Thanks for your help

     

     

    #12083

    Chris
    Keymaster

    Hi,

    If your hidden field isn’t part of a plugin, you may not see it even with the document inspector.

    Instead, add this code in your ‘functions.php’ to un-hide all custom fields:

    function mymeta() { return false; }
     add_filter('is_protected_meta', 'mymeta', 10, 3);

    It may also be easier to start simple: try importing ‘sample.csv’.  If that works, then add a custom field column called “mytestfield” to that file and import it again.  And if that works for you, try it again with the column “_mytestfield” before moving on to “_post_type”, etc.

    If that doesn’t help, please email me (chris at wphostreviews.com) with a few lines of your input file and a login to your blog so I can take a look.

    #12084

    LakesMarketing
    Participant

    Hi Chris,

    Thanks for your message. I code for the functions.php seemed to work OK and I managed to see the fields in the list. But once imported can see they have imported into custom fields that I seem to have created rather than the Templates Custom Fields.

    I have emailed you a screenshot and access details.

    Many thanks,

    Nick

    #12099

    Chris
    Keymaster

    Hi,

    Just to wrap up this thread for anyone else who is reading: I think we discovered the theme in this case isn’t saving its options into WordPress custom fields, so TurboCSV can’t import them.

    If you discover how to read/write those theme settings, please let me know via email or here.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.