Additional Information for Custom Fields in CustomPress

Hello,

I just went through your tutorial for CustomPress but cannot find the additional information I need. What I am trying to do is design a custom post type for inputting obituaries for a funeral home. I've figured out the easier fields, but there is a dropdown field where the name of the location would be displayed (funeral home, name of church, etc.) and I need the name chosen to also display the location address and (in a perfect world) a map of that location (perhaps using your google maps plugin?).

I am also wondering as to how to style the information that appears? Right now it displays as a bulleted list:
- Date of Birth 11/01/2015
- Date of Death 01/01/2016
- Service Catholic Mass

I figure I can add the colon after the name (although it would be nice to bold the field name or change the text colour so that there is some clarity between the field name and the data it displays), but how do I get rid of the bullets? I would at least like it to display as this at least:
Date of Birth: 11/01/2015
Date of Death: 01/01/2016
Service: Catholic Mass
Location: St. Anthony's Catholic Church
(This ideally would be where the church address appears and a map if possible)

  • Predrag Dubajic

    Hey @1062,

    Hope you're doing well today :slight_smile:

    Could you please elaborate this part a bit more:

    I just went through your tutorial for CustomPress but cannot find the additional information I need. What I am trying to do is design a custom post type for inputting obituaries for a funeral home. I've figured out the easier fields, but there is a dropdown field where the name of the location would be displayed (funeral home, name of church, etc.) and I need the name chosen to also display the location address and (in a perfect world) a map of that location (perhaps using your google maps plugin?).

    I'm not quite sure what are you trying to do. Where is the address entered, where are you looking to show the address?

    To add colon simply enter it as your custom field field name, so instead naming it Date of Birth simply name it Date of Birth: and that should be it.

    As for changing color and removing bullets this CSS code should take care of that part:

    .ct-custom-field-block ul li {
        list-style-type: none;
    }
    
    .ct-custom-field-block ul li span {
        color: #174F70;
    }

    If your theme doesn't have custom CSS field, then you may wish to use a child theme or a plugin like this one for this additional CSS. That way you're protected when you come to upgrade.

    Best regards,
    Predrag

    • 1062

      This is the tutorial I referred to: https://premium.wpmudev.org/blog/working-with-custompress/

      For my requirements, one of my custom fields (Location) is a dropdown field displaying a list of churches and venues in my city. What I need to know is if it's possible to customize the selection in the dropdown field (the church/venue that is selected) so that it also displays the address and hopefully a google map. E.g.
      Date of Birth: 11/01/2015
      Date of Death: 01/01/2016
      Service: Catholic Mass
      Date & Time: January 5, 2016 at 10:30 am
      Location: St. Anthony's Catholic Church
      1234 St. Anthony's Street
      My Town, Province
      (Map would go here)

      I am also wondering if it would be possible for CustomPress to automatically create it's own post (rather than having to input the data in the custom "plugin" and then creating a new post for it to appear). Or alternatively, would it be better to not bother using CustomPress and maybe try to customize something like the Events plugin for this purpose instead?

  • Adam Czajczyk

    Hello 1062,

    I hope you're well today!

    For my requirements, one of my custom fields (Location) is a dropdown field displaying a list of churches and venues in my city. What I need to know is if it's possible to customize the selection in the dropdown field (the church/venue that is selected) so that it also displays the address and hopefully a google map. E.g.
    Date of Birth: 11/01/2015
    Date of Death: 01/01/2016
    Service: Catholic Mass
    Date & Time: January 5, 2016 at 10:30 am
    Location: St. Anthony's Catholic Church
    1234 St. Anthony's Street
    My Town, Province
    (Map would go here)

    Just to make sure that we're on the same side here: what you'd like to do would be to show that additional data inside the drop-down list or should that appear somewhere on the page once an item is selected from the drop-down list? Also (I didn't get it from your description), were you able to setup the custom post finally as expected or do you need also help on this?

    Best regards,
    Adam

  • 1062

    Wow, I'd given up on hearing back. Thank you for responding. We want to the additional data to appear somewhere on the page once an item is selected from the drop-down list. The custom posts do not display quite as I would like, I have been trying out Types from WP toolset as well and it seems to have a few more features to be honest. I was hoping to be able to use CustomPress but so far it doesn't seem to be able to do what I need it to fully. If you have any suggestions, I'd love to hear them.

  • Adam Czajczyk

    Hello 1062,

    Thanks for your answer. I must admit though that I'm still a bit confused. Here's how I see this:

    - there are three sets of data
    - one is church/venue (it would then include its name and address)
    - second one would be the "service type" and "date&time"
    - third one would be "Date of Birth" and "Date of Death"

    The question (apart from how should it be displayed, which I think get it now) is how are those sets of data connected?

    Since I don't know how your service is meant to work, I'm not sure whether all of those "sets" would be connected "one to one" or are there many combinations possible. If these would be combinations, are they somehow selectable by site user or should be setup by site admin (via some kind of back-end interface) or will be pre-defined direcly on custom post level?

    Please advise!
    Best regards,
    Adam

  • 1062

    Hello,

    The sets of data are to only be entered by our admins through the wordpress menu, as if it were a plugin. Ideally, we will have a page template added to our theme with the custom field codes embedded so that when our admins enter a new obit, the post page displays it properly. I have attached screenshots with explanations since there is confusion. Can you please just tell me if CustomPress can even do this? Otherwise I can just stop wasting my time and move on to a different solution. Thank you for your help.

  • Predrag Dubajic

    Hi @1062,

    This is not something possible out of the box but with some additional coding it could be possible.

    Since you will be using custom template for your custom post type single post you can check the field value and based on that show desired address and map created for each church using our google maps plugin.

    It would look something like this:

    $my_variable = CUSTOM_FIELD_VALUE;
    if( $my_variable == CHURCH_ONE) {
    	echo "Adress: ADDRESS_ONE";
    	echo do_shortcode( '[map id="1"]' );
    } elseif( $my_variable == CHURCH_TWO) {
    	echo "Adress: ADDRESS_TWO";
    	echo do_shortcode( '[map id="2"]' );
    } //and repeat for each church

    Hope this helps you getting started.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.