WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Events Manager] Pagination location: insert at top

[Plugin: Events Manager] Pagination location: insert at top

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi,

    You can try the pagination code at templates/events-list.php

    Using Template Files

    Yes … I’ve read that documentation .. and I’ve created a templates overrides folder under my theme …

    in looking at templates/events-list.php … I don’t know what to change to make the pagination display on top of the list

    please advise.

    If you place the code below directly above if( $events_count > 0 ){ this should place pagination above your list. This will likely show it twice though so you will need to modify the existing code to remove the below pagination, if desired. Not fully tested that but could do the trick. Hope that helps.

    if( !empty($args['limit']) && $events_count > $args['limit'] ){
    			//Show the pagination links (unless there's less than $limit events)
    			$search_args = EM_Events::get_post_search() + array('page'=>'%PAGE%','_wpnonce'=>$_REQUEST['_wpnonce']);
    			$page_link_template = preg_replace('/(&|\?)page=\d+/i','',$_SERVER['REQUEST_URI']);
    			$page_link_template = em_add_get_params($page_link_template, $search_args);
    			echo apply_filters('em_events_output_pagination', em_paginate( $page_link_template, $events_count, $args['limit'], $args['page']), $page_link_template, $events_count, $args['limit'], $args['page']);
    		}

    thanks for the assist … I had put a variation of that snippet where you suggested before … but I couldn’t find a way to enclose it with a DIV or better yet … a UL … so that I can position and style it better ..

    any suggestions on where I could place the open/close tags to contain the pagination??

    Also .. in the em-functions file, it says that it’s overridable in my theme directory … but when I copy over the em-functions file to my theme and edit it … the default em-functions is still being used … any suggestions?

    TIA

    Plugin Author Marcus

    @netweblogic

    put code above between your open/close tags (e.g. div tags) and style accordingly.

    the em-functions file isn’t overridable, where did you read that?

    hugh?? sorry … what exactly are you saying?

    “put code above between your open/close tags”

    above what?
    between what?
    “MY” open/close tags?

    I like to think I’m fairly literate … but you lost me … *grin*

    perhaps I misunderstood the following in the em-functions file
    “if(!function_exists(’em_paginate’)){ //overridable e.g. in you mu-plugins folder.”

    Hi,

    please try this:

    Insert code below line if( $events_count > 0 ){

    ?>
    <div>
    <?php
    if( !empty($args['limit']) && $events_count > $args['limit'] ){
    			//Show the pagination links (unless there's less than $limit events)
    			$search_args = EM_Events::get_post_search() + array('page'=>'%PAGE%');
    			$page_link_template = preg_replace('/(&|\?)page=\d+/i','',$_SERVER['REQUEST_URI']);
    			$page_link_template = em_add_get_params($page_link_template, $search_args);
    			echo apply_filters('em_events_output_pagination', em_paginate( $page_link_template, $events_count, $args['limit'], $args['page']), $page_link_template, $events_count, $args['limit'], $args['page']);
    }
    ?>
    </div>
    <?php

    gotcha … block it out in the event-list … then assign individual open/close to each element in the em-functions .. got it

    thanks a bunch …

    UGHH … that only took care of the top … I enclosed it with a UL then each item with a LI … works great on the top .. but the bottom is not getting the UL .. so I tried the same thing … close and reopen the PHP and added the UL … no go .. UGHH …

    any ideas on breaking the bottom version like we did for the top??? would like to assign the same styles and values to both …

    Hi,

    it’s should be the same? can you post the code that you tried in the bottom?

    thought so to … here it is ..

    <?php
    if( $events_count > 0 ){
    	//If there's a search, let's change the pagination a little here
    	if(!empty($_REQUEST['_wpnonce']) && wp_verify_nonce($_REQUEST['_wpnonce'], 'search_events')){
    		$args['pagination'] = false;
    		echo EM_Events::output( $events, $args );
    		//do some custom pagination (if needed/requested)
    ?>
    <ul class="paginateList">
    <?php
    		if( !empty($args['limit']) && $events_count > $args['limit'] ){
    			//Show the pagination links (unless there's less than $limit events)
    			$search_args = EM_Events::get_post_search() + array('page'=>'%PAGE%','_wpnonce'=>$_REQUEST['_wpnonce']);
    			$page_link_template = preg_replace('/(&|\?)page=\d+/i','',$_SERVER['REQUEST_URI']);
    			$page_link_template = em_add_get_params($page_link_template, $search_args);
    			echo apply_filters('em_events_output_pagination', em_paginate( $page_link_template, $events_count, $args['limit'], $args['page']), $page_link_template, $events_count, $args['limit'], $args['page']);
    		}
    ?>
    </ul>
    <?php
    	}else{
    		echo EM_Events::output( $events, $args );
    	}
    }else{
    	echo get_option ( 'dbem_no_events_message' );
    }

    all I really did was close the php , add the html, then opened the php again …

    Hi,

    the reason why is because when there is nothing to search by default this line will be use

    }else{
    	echo EM_Events::output( $events, $args );
    }

    yeppers … noticed that .. what a pain …

    I went ahead and just copied the top paginate to the bottom .. then stripped any and all of the “args” from the search query

    it’s not elegant … but it works …

    thanks for all the help ..

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: Events Manager] Pagination location: insert at top’ is closed to new replies.