corageroux

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Get event ID from within a function for ACF field retrieval #64606
    corageroux
    Participant

    Hi Mate

    I hear what you are saying, but using the default events template circumvents everything I worked to deliver for my client. They can dynamically assign sidebars and layout on every other page of the site, so I would like to deliver the same on their events pages. The very nature of this functionality requires the code to run just before the main loop, as it determines the very structure of the page – i.e. it controls the wrapping markup of the page content.

    So, I’ll go with the Default Page Template and just grab the data from the $wp_query object.

    Thanks for your help, I appreciate it. Getting used to a new plugins behaviour can be such a drama when all you wanna do is get the site live.

    Thanks, Barry.

    in reply to: Get event ID from within a function for ACF field retrieval #64574
    corageroux
    Participant

    Hi Barry, thanks for replying.

    I am aware that I can select a different template to use as the ‘wrapper’ for TEC, but that won’t help me.

    Basically, I’m saving post meta to individual events pages (using the Advanced Custom Fields plugin), and that post meta will be saved to the event ID. The data saves just fine, as I can see it appears in the default WP custom fields meta box. The problem is retrieving that meta data for each event. The -9999 wrapper you mention, applies to ALL pages/events related to TEC. So, when I use the ACF API get_field() function, it tries to find meta data for a post ID of -9999 and, of course, returns false, because the meta data is stored under the event’s ID, not the wrapper’s.

    I should mention that the meta field works flawlessly on all other posts, pages, and CPTs, so we can save some time here and bypass the whole debug process.

    I really need to know how to get the event ID from within a function that is called from a page template.

    The TEC functions in the documentation work when called directly within a page template, but I use a different system. All that resides in my pages templates is one function call that initialises the whole page through a series of function calls handled elsewhere.

    Here is a crude example – http://pastebin.com/wkP26wFf

    I hope this makes sense? Perhaps this is a question for one of the TEC devs?

    Cheers
    Phil

    in reply to: Is there any way to place events on a spacific page? #64559
    corageroux
    Participant

    The question is fairly simple. accessrose would like to know how to manually place the calendar in an existing WP page. Most plugins would make this feature available via a shortcode that can be dropped into the post content – obviously not a feature that TEC supports.

    Perhaps there is a function that can be called from within a theme template? This would be a question for the plugin developers.

    in reply to: Get event ID from within a function for ACF field retrieval #64558
    corageroux
    Participant

    Hello? This is a premium forum, right? If someone could shed a little light on this issue, I’d really appreciate the help.

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