Okay
  Public Ticket #3368740
Showing elements on custom single page
Closed

Comments

  •  1
    klick_media started the conversation

    Hello!

    Im setting up a custom single page event view but im having a hard time getting the different data in from the backend. So im not using Elementor but the a custom single-stec_event.php template, and pulling in the_post_thumbnail_url(), the_title() and the_content() - but i want to display more stuff, like time, author, location and all the other stuff, but i cant fint the documentation on how to pull in that data?

  •  785
    Zhivko replied

    Here is example of obtaining some of the event data:

    $event         = new Event_Post(get_the_ID()); // @see assets\php\o.event.php for all methods
    $repeat_offset = (int) get_query_var('stec_repeat_offset', 0); // the event repeat offset in seconds if event is repeating // title $title = $event->get_title(); // start date
    $start_date = $event->get_start_date('Y-m-d H:i:s', $repeat_offset); // end date
    $end_date = $event->get_end_date('Y-m-d H:i:s', $repeat_offset); // description
    $description = $event->get_description(); // author data
    $author_id = $event->get_author();
    $authod_data = get_userdata($author_id);
    $author_name = $authod_data->display_name; // location
    $location = $event->get_parsed_location(); if ($location) {
        $full_address = $location->full_address; // @see assets\php\o.location.php get_data()
    } // all front data
    $all_data = $event->get_front_data();


    1254941422.png

    Check out file stachethemes_event_calendar / assets / php / o.event.php

    and use get_front_data method as a reference



    Stachethemes Developer

  •  1
    klick_media replied

    Hello again!

    Thx for the reply - I cannot acces the class Event_Post granting access to the front_data object. The method isn't working and i get this error:

    4443031918.png

    This is my code: 

    9351248720.png


  •  785
    Zhivko replied

    The Event_Post class resides in Stachethemes\Stec namespace like this:

    4524787937.png



    Stachethemes Developer

  •  1
    klick_media replied

    Thank you, this worked!