WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Not Being Able to Display Events List On Homepage

[Resolved] Not Being Able to Display Events List On Homepage

  • I’m currently trying to get a list of events to display on the front page, where I’m able to then on the bottom to have the option to go to different pages to be able to display them, such as on this page. The page I’m trying to get it to load on is on this page.

    I’ve tried placing shortcode into the page via WordPress, using [events_list limit=”10″][/events_list] and being able to link it to one of the temporary files. But, still doesn’t work.

    I’m stuck on what to include in my main template file to be able to have it display? Any help is appreciated!

    http://wordpress.org/extend/plugins/events-manager/

Viewing 7 replies - 1 through 7 (of 7 total)
  • try something like:

    [events_list limit=”10″]
    #_EVENTNAME
    [/events_list]

    OR

    [events_list limit=”10″]

    Placeholders

    Also, can I know what do you mean by “But, still doesn’t work.”?

    What I meant was by the “But, still doesn’t work.” is that when I tried inputting the following shortcode after trying to first method, it still displayed the same message. I tried again to do the same thing, but still doesn’t display the events on the main page.

    But, there was some code that was used to create the events table on the page. I commented out the code and this magically popped up during deletion in the main template used just on that page:
    </$size;$i++)>

    The original code I implemented and commented out was the following:

    <?php
    				$page = ( !empty($_REQUEST['page']) && is_numeric($_REQUEST['page']) )? $_REQUEST['page'] : 1;
    
    $args = array(
                   'limit' => 10,
    			   'scope' => 'today',
    			   'pagination' => 1
    			   );
    
    if (isset($_REQUEST['c'])) {
    $args['category'] = $_REQUEST['c'];
    $args['scope'] = 'future';
    }  			   
    
    $args['offset'] = $args['limit'] * ($page-1);
    
    $events = em_get_events_array($args);
    $size = sizeof($events)-1;
    
    echo "<table cellpadding='0' cellspacing='0' id='current-events' >";
    
    for ($i=0;$i<$size;$i++) {
    echo "<tr><td class='startdate_cost_td'>
          <span  class='start_time'>" . $events[$i][0] .
          "</span><br/><span class='cost'>" . $events[$i][3] .
          "</span></td><td class='event_image'>";
    
    		      if ($events[$i][5] == '') {
                echo "<img src='../../../wp-includes/images/default_img.jpg' />";
                }
                else {
                echo $events[$i][5];
                }
    
    echo  "</td><td class='event_title'>" . $events[$i][2] .
          "<br/><i><span class='location_name'>@". $events[$i][1] .
          "</span></i><br />" .$events[$i][4] .
          "<div id='read_more_wrapper'>" .
          "<img src='../../../wp-includes/images/little_pink_arrow.jpg' /><a href='" . $events[$i][8] . "' class='pink_link'>READ MORE</a></td></tr>" .
          "</div>";
          } 
    
    echo "</table>";
    $last_index = count($events) - 1;
    echo $events[$last_index][0];
    ?>

    I’m wondering now, if you look on testbuzz.illinimedia.com, how now to get the events to display properly (like this events pages?

    just copy your formattings at Settings > Formatting > Events > Default event list format header/Default event list format/Default event list format footer

    e.g.

    [events_list format_header=”copy <Default event list format header>” format_footer=”copy Default event list format footer”]

    copy Default event list format

    [/events_list]

    I also tried the formatting on the initial page as you said, but still has the events displaying incorrectly.

    Here’s what I used in the shortcode:

    [events_list format_header="<table cellpadding='0' cellspacing='0' id='current-events' >" format_footer="</table>"]
    <tr>
    		<td class='startdate_cost_td'>
          			<span class='start_time'>#_12HSTARTTIME</span><br />
    			<span class='cost'>#_ATT{Cost}{Free}</span>
    		</td>
    		<td class='event_image'>{has_image}#_EVENTIMAGE{/has_image} {no_image}<img src='../../../wp-includes/images/default_img.jpg' />{/no_image}</td>
    		<td class='event_title'>#_EVENTNAME<br />
    			<i><span class='location_name'>@ #_LOCATIONNAME</span></i>
          		<div id='read_more_wrapper'>
          		<img src='../../../wp-includes/images/little_pink_arrow.jpg' /><a href='#_EVENTURL' class='pink_link'>READ MORE</a></div></td></tr>
    
    [/events_list]

    try to put some image width and height

    e.g. #_EVENTIMAGE{x,y} where x and y are width and height

    Are you referring to putting the #_EVENTIMAGE{x,y} in the shortcode above?

    The only way at the moment it seems the events are being read onto the page is using the following code (the majority of it being commented out, but somehow still reading in the template file, even the –> at the end of the PHP):

    <!-- <?php
    				$page = ( !empty($_REQUEST['page']) && is_numeric($_REQUEST['page']) )? $_REQUEST['page'] : 1;
    
    $args = array(
                   'limit' => 10,
    			   'scope' => 'today',
    			   'pagination' => 1
    			   );
    
    if (isset($_REQUEST['c'])) {
    $args['category'] = $_REQUEST['c'];
    $args['scope'] = 'future';
    }  			   
    
    $args['offset'] = $args['limit'] * ($page-1);
    
    $events = em_get_events_array($args);
    $size = sizeof($events)-1;
    
    echo "<table cellpadding='0' cellspacing='0' id='current-events' >";
    
    for ($i=0;$i<$size;$i++) {
    echo "<tr><td class='startdate_cost_td'>
          <span  class='start_time'>" . $events[$i][0] .
          "</span><br/><span class='cost'>" . $events[$i][3] .
          "</span></td><td class='event_image'>";
    
    		      if ($events[$i][5] == '') {
                echo "<img src='../../../wp-includes/images/default_img.jpg' />";
                }
                else {
                echo $events[$i][5];
                }
    
    echo  "</td><td class='event_title'>" . $events[$i][2] .
          "<br/><i><span class='location_name'>@". $events[$i][1] .
          "</span></i><br />" .$events[$i][4] .
          "<div id='read_more_wrapper'>" .
          "<img src='../../../wp-includes/images/little_pink_arrow.jpg' /><a href='" . $events[$i][8] . "' class='pink_link'>READ MORE</a></td></tr>" .
          "</div>";
          } 
    
    echo "</table>";
    $last_index = count($events) - 1;
    echo $events[$last_index][0];
    ?> -->
                     </$size;$i++)>

    The way the main page event’s should be displaying is like on the following page. Here’s a screenshot of it as well: https://docs.google.com/open?id=0B2UC67NQiW2yalhMSGxra0FFWGM

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Not Being Able to Display Events List On Homepage’ is closed to new replies.
Skip to toolbar