Events without detail page – non clickable
-
Hi there!
I’ve been using the Events Manager for a few months now and I’m still thrilled with it! However, I would like to customize the plugin a bit. I want to create events that are displayed in the calendar and event lists (with date and everything) but do not have a details page. In other words, they should not be clickable.
I have now created a custom placeholder “EventDetails”, with which one i can select “Yes” or “No”. With “#_ATT{EventDetails}”, I can also display “Yes” or “No” on the detail pages as well as in the event lists. However, I can’t process the values further in PHP. I tried it this way:
$hasDetails = do_shortcode("#_ATT{EventDetails}"); if($hasDetails == "Yes") { echo "#_EVENTLINK"; } else { echo "_EVENTNAME"; }
Unfortunately, that doesn’t work. The interresting thing is that “echo $hasDetails; gives out the expected “Yes” or “No” but “var_dump($hasDetails)” gives out a string(19) and i dont know why.
However, when I try to access the content of the field using “get_post_meta()”, it only works on the Event Page because I can get the Post-ID with get_the_ID(). But this doesn’t work on the page that displays the event list because i can’t get the right Event-ID. The ID of the page who is schowing the event list is always used. (Maybe php doesn’t recognize that its in the has_posts() loop.)
i got pretty stuck in this. Does anyone have an idea how I can achieve my goal, or am I overlooking something?
Thank you all and greets from Germany!
The page I need help with: [log in to see the link]
- The topic ‘Events without detail page – non clickable’ is closed to new replies.