Still having trouble with adding content above calendar

Home Forums Calendar Products Events Calendar PRO Still having trouble with adding content above calendar

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #31072
    Greg
    Participant

    Jonah had previously helped me out with this issue: https://theeventscalendar.com/support/forums/topic/shortcodes-in-page-template/#post-30866

    As suggested, I installed the Advanced Custom Fields plugin with Options add-on. I created a custom field group and an option. The field name is “calendar_text”.

    In my functions.php I created a filter to display this on the calendar month page only, along with some text:

    add_filter( ‘genesis_after_post_title’, ‘genesis_after_post_title_filter’ );
    function genesis_after_post_title_filter() { ?>

    text text text

    <? }

    The text displays, but the option I added does not. This is what happened when I tried to add a shortcode, as well as the template code from the Improved Include Plugin. This leads me to believe it's not a problem with the ACF plugin, but I'm not sure I have the template code right for ACF either. Can you please help?

    #31073
    Greg
    Participant

    Hmm not all my code displayed:
    function genesis_after_post_title_filter() { ?>

    text text text

    <? }

    #31074
    Greg
    Participant

    Grr…how do you post code on here?

    #31075
    Greg
    Participant

    This is the code I have to call my option:

    #31076
    Greg
    Participant

    [code][/code]

    #31077
    Greg
    Participant

    Sorry, obviously I don’t know what I am doing 🙁

    #31078
    Greg
    Participant

    the_field($calendar_text, ‘option’);

    #31148
    Jonah
    Participant

    Hi Linda,

    Can you please post the code you are using to http://snippi.com/

    Thanks,
    Jonah

    #31149
    Leah
    Member

    Hey Lindy,

    As you’ve found, posting code into the forums doesn’t work. If you could please post it using Pastebin, Gist or a similar service, that would be great.

    Cheers,
    Leah

    #31260
    Greg
    Participant

    Thanks for being patient with me 🙂
    Here’s my code. http://snippi.com/s/2rcpta0
    As I mentioned above, the text displays, but the option I added does not. This is what happened when I tried to add a shortcode, as well as the template code from the Improved Include Plugin. This leads me to believe it’s not a problem with the ACF plugin, but I’m not sure I have the template code right for ACF either. Can you please help?

    #31263
    Jonah
    Participant

    Hi Lindy,

    If your custom field is ‘calendar_text’ then you need to call it like this instead:

    the_field('calendar_text', 'options');

    Please see the Advanced Custom Fields documentation for more info: http://www.advancedcustomfields.com/docs/

    Cheers,
    Jonah

    #31265
    Greg
    Participant

    So I did that, and now my calendar moved over to the left and some random text appeared below the calendar. The text I added via the options add-on is still not appearing above the calendar.

    http://www.vacationsinc.com/events/

    #31273
    Jonah
    Participant

    Hey Lindy,

    Sorry about that, it should be:

    the_field('calendar_text', 'option');

    And it looks like you should be able to use the variable name too… I’m not sure why it’s not working for you. Make sure you have the custom field created and perhaps try posting to the ACF support forum to see why it’s not working for you.

    – Jonah

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Still having trouble with adding content above calendar’ is closed to new replies.