• Resolved SuperGraham

    (@supergraham)


    I’m using Stellar Places to provide a dive sites option for dive centers. I’ve managed to customise the stlr_place custom post type to say Dive Sites instead of Places, but now I want to add custom meta data, such as depth. I’d also like to remove any custom meta data referring to addresses. How would I do this? I’ve tried my own code but I struggled. Can you help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • It is entirely possible to add custom meta, but currently that would have to be done via an additional meta box. I assume you want to add that field to the existing meta box?

    Are you just wanting help with the additional fields in the admin, or on the front end as well?

    Regarding address fields, is your primary concern the display of the address fields in the admin, on the front end, or both?

    Thread Starter SuperGraham

    (@supergraham)

    I want to add the fields to new meta boxes not the existing one – I’d actually like to hide the existing address fields as dive sites don’t have postal addresses ?? Once I have one field, I’d like to add it to the front end too. If I have one working I would be able to sort the rest.
    I did find some code that adds custom fields and meta data but it didn’t work for me, I’m not a developer. If all you have is a sample that works, that would work too.

    Thread Starter SuperGraham

    (@supergraham)

    Actually, I worked that out. Problem solved.

    So I need to be able to disable the address fields for stlr_place. PLus, how do I add a gallery field to stlr_place?

    There are a few options with regard to the address fields:

    1. You can simply not fill out (or generate) the address fields
    2. You can hide the address fields in both the admin and front end using CSS.
    3. You can disable the ‘Location’ meta box altogether and create a new meta box containing only the fields for GPS coordinates.

    I’m not sure which of the above would work best for you. Obviously the first would require no effort, but could be an issue if you have other people who may not know better entering content.

    As far as a “Gallery Field”, what do you have in mind for that? Is that just a collection of images? If so, is there a reason that the existing gallery functionality in WordPress wouldn’t suffice? (If you aren’t familiar, you can click the ‘Add Media’ button above the content editor and select ‘Create Gallery’)

    Thread Starter SuperGraham

    (@supergraham)

    Address fields – yes, I know CSS would work but I was hoping that I could stop the fields being registered in the first place. As I can hide the entire fieldset, that will do.
    Gallery – yes, I am aware of that, and that’s probably the easiest option. I saw the ‘Product Images’ meta-box for WooCommerce products and thought it was a standard option, but it appears that it’s custom WooCommerce code so not a quick job. I guess the simplest option is to use gallery plugin if the standard WP shortcode doesn’t suffice.

    Thanks for the help

    @supergraham

    Here is a quick plugin I threw together that will remove the locations meta box and replace it with a geo coordinates meta box: https://dl.dropboxusercontent.com/u/521087/stellar-places-customizations.zip

    Thread Starter SuperGraham

    (@supergraham)

    Thanks a lot – that’s going to help. What I like about your plugin is that it’s a CPT, which means it’s much more manageable.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom Meta Data’ is closed to new replies.