Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • I had this same problem. I solved it by switching the theme and then switching back. Hopefully this gets rectified in a future update so that my client doesn’t experience a similar problem. Thanks for creating an amazing plugin!

    Thread Starter pikatzu

    (@pikatzu)

    Thanks for your support thus far.

    I tried the function above, but it returns an error saying “Fatal error: Call to a member function get_location() on a non-object”

    My code at the moment is as follows:

    $args = array('post_type'=>'event', 'posts_per_page'=>7, 'order_by'=>'start_date');
    
    $the_query = new WP_Query($args);
    
    while ($the_query->have_posts() ) :
    	$the_query->the_post(); ?>
    
    	<h1><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h1>
    	<?php $EM_Event->get_location()->location_name; ?>
    	<br/><br/>
    
    <?php
    	endwhile;
    ?>

    I am doing it this way because I would like to format a landing page that is customised to a mockup that I have done. Was trying to get the start date, start time, event category, event title, event location and start time. I’d like to return these values unformatted so that I can apply my own formatting, but this seems impossible.

    Thread Starter pikatzu

    (@pikatzu)

    Thanks so much for the information you have given me so far guys. I am still having a problem because whenever I try to get just the info entered into the content field by calling the_content(); it pulls all the information including the info that I dont need such as the map location and the formatted date. Is there a place where I can get access to all the template tags used, such as the_field('entry_fee', $id)?

    I would like to get specific information like location name, time, and the description. I’ve gone through what seems to be all the relevant documentation on the site and have ended up more confused than I was before I started.

    Thread Starter pikatzu

    (@pikatzu)

    Hi Phil,

    Thanks for the advice. I have had a look at the EM_Event::output() method. The function I am looking for seems possible if i use the ‘format’ argument, and pass a very long string into it. This is the code that produces the loop:

    <?php
    if (class_exists('EM_Events')) {
    	echo EM_Events::output( array('limit'=>7, 'orderby'=>'start_date', 'format'=>'
    
    	<div class="single_event">
    		<div class="event_date">#_{ F j Y}</div>
    		<div class="event_img">#_EVENTIMAGE</div>
    		<div class="event_title">#_EVENTLINK</div>
    		<div class="description">#_EVENTNOTES</div>
    	</div>
    
    	') );
    }
    ?>

    This is all well and good to produce some aspect of my desired results. However, is there another way to format the layout of the page?

    For instance, I would like to perform some form of processing on each title. There doesn’t seem to be a way to return a particular attribute from the result of the query. For example, I can do this with wordpress tags, but not with EM:

    <?php
    $the_query = new WP_Query( $args );
    
    while ( $the_query->have_posts() ) :
    	$the_query->the_post();
    	echo '<li>' . get_the_title() . '</li>';
    	$title = get_the_title();
    endwhile;
    
    ?>
    Thread Starter pikatzu

    (@pikatzu)

    Hi angelo. Thanks for the link. I learned some important template tags and placeholders from it. However, it doesn’t show how to access this is as a loop on an archive page. For instance if i want to take this sort of approach to display this info in a loop

    <?php while ( em_events() > 0 ) {?>
    
    <div class='single-event'>
      <div class="event-date'>[the_date_for_the_event]</div>
      <div class='event-img'>[the_image_for_the_event]</div>
      <div class='event-title'>[the_title_for_the_event]</div>
      <div class="description'>[a_short_excerpt_of _description]</div>
    </div>
    
    <?php } ?>

    The webpage you directed me to shows information on how to get the attributes of a single event using em_get_event($post->ID, 'post_id'). I’d like to be able to get an array of all the event items matching a query, and their respective attributes listed in the above code block.

    oops, forget what i said. I got the problem again. Bloody thing

    I had the same problem and I did what taruntanu suggested. I didnt delete the theme though (cos ive done a hella lot with it and didnt wanna lose everything). I moved it to a folder on my computer, away from its default location. I logged back into my website (which was blank by the way) then typed in the /wp-admin as usual and there it was! After that I deleted the plugins that I was unsure of (quite a few) then I loaded my theme folder back into its default location. After I did that everything worked perfectly.

Viewing 7 replies - 1 through 7 (of 7 total)