WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Pagination location: insert at top (16 posts)

  1. cmj2kul
    Member
    Posted 2 years ago #

    Hello ..

    I've searched and searched and I cannot seem to find it.

    I would like to insert the pagination at the TOP of the list as well as the bottom

    Please direct me to where I can make this happen.

    Thanks in advance.

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

  2. agelonwl
    Member
    Posted 2 years ago #

    Hi,

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

    http://wp-events-plugin.com/documentation/using-template-files/

  3. cmj2kul
    Member
    Posted 2 years ago #

    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.

  4. rontarson
    Member
    Posted 2 years ago #

    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']);
    		}
  5. cmj2kul
    Member
    Posted 2 years ago #

    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

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    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?

  7. cmj2kul
    Member
    Posted 2 years ago #

    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."

  8. agelonwl
    Member
    Posted 2 years ago #

    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
  9. cmj2kul
    Member
    Posted 2 years ago #

    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 ...

  10. cmj2kul
    Member
    Posted 2 years ago #

    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 ...

  11. cmj2kul
    Member
    Posted 2 years ago #

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

  12. agelonwl
    Member
    Posted 2 years ago #

    Hi,

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

  13. cmj2kul
    Member
    Posted 2 years ago #

    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' );
    }
  14. cmj2kul
    Member
    Posted 2 years ago #

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

  15. agelonwl
    Member
    Posted 2 years ago #

    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 );
    }
  16. cmj2kul
    Member
    Posted 2 years ago #

    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 ..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic