Advanced Custom Fields values being stripped out

Home Forums Calendar Products Events Calendar PRO Advanced Custom Fields values being stripped out

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #45630
    joeleadedesign
    Participant

    Hi Guys,

    I’m trying to get fancy and use ACF to allow my client to set a background color or a background image for an event by setting an inline style for a “td” in “table.php”, however I’m having an issue with the ACF values being stripped out.

    I’ve disabled all plugins except ACF & Event Calendar/PRO, set my theme to TwentyEleven. I’ve tried saving “table.php” inside an “events” folder in the TwentyEleven theme folder, as well as editing “table.php” in the plugin folder (just for testing purposes).

    I’ve also created an ACF text field and inserted it in the “table.php” file between an h1 tag, just below the header. If I view the source code I can see the h1 tags but the field value is missing. Doing the same thing for the TwentyEleven default page template shows the field value.

    I can send screenshots if required. I’m developing on localhost so unfortunately I can’t post a link.

    Thanks in advance,

    Joel

    #45676
    Jonah
    Participant

    Hi Joel,

    Please post some code samples of what you’re working with. I.e. the name of the field, the code you are using in table.php, etc. Please post code samples to http://snippi.com/

    Thanks,
    Jonah

    #45711
    joeleadedesign
    Participant

    Thanks for the quick reply, Jonah.

    Below are links to the code samples for the text field:

    table.php – saved to the “events” folder of my active theme
    http://snippi.com/s/gl4todo (line 36)

    Events Page
    http://snippi.com/s/ufum6fz (line 217)

    If it helps I could do a video screen capture or send a link to a BackUp Buddy zip file.

    Thanks!

    Joel

    #45714
    joeleadedesign
    Participant

    Sorry, slight amendment. I’d switched back to my custom theme, and used that in my code sample for the Events Page.

    I’ve reactivated TwentyEleven and have updated http://snippi.com/s/ufum6fz. The empty h1 tag is now on line 144.

    #45838
    Jonah
    Participant

    Hi Joel,

    Ok, on the H1, do you have a field named ‘test’ and where are you populating this field? It seems to me you would want to be using the ACF Options page add-on and if that’s the case, you would need to call the field like this instead:

    the_field('test', 'options');

    Not sure about the other field though. If you we’re wanting to modify the background color for an event in the calendar, you would want to add this to the div in the display_day function on line 125 of table.php

    Does that help?

    #46043
    joeleadedesign
    Participant

    Hi Jonah,

    My sincere apologies for wasting your time. I’m not sure what I’d done wrong but I now have it working. I think I may have assigned the ACF field to the wrong post type, as I’m now able to set a background color and/or background image, as well as having text field values appear.

    Thanks for your advice on where to add the style css. It worked a treat! I now have to put my jQuery hat on and set the height of the event in the td based on the number of events on that day i.e. two events, height = 50%, three events, height = 33%. Here’s a pic of what I’m trying to achieve – http://imgur.com/rusOuJE. Wish me luck!

    Cheers,

    Joel

    #46075
    Jonah
    Participant

    Hi Joel,

    Sounds good and no worries. I’m glad you got it all figured out. If there’s anything else you need help with, please let us know!

    Thanks,
    Jonah

    #46393
    joeleadedesign
    Participant

    Hi Jonah,

    Apologies for the poor video quality. It was my first recorded Gogole+ Hangout 🙂

    I’ve posted snippets with The Event Calendar “table.php” and custom jQuery here –
    table.php: http://snippi.com/s/ehua0uq
    jQuery: http://snippi.com/s/ooj4w6y

    My friend, Ben Pearson, helped with the jQuery and has made a Codepen post here – http://codepen.io/benpearson/pen/mazry

    Have a great day,

    Joel

    #978965
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Advanced Custom Fields values being stripped out’ is closed to new replies.