简体   繁体   中英

How add pagination for Avada theme with pods plugin

I have a problem displaying the pagination of car photos.

I use the Wordpress AVADA theme and the PODS plugin with which I created the "cars" page with photos

I tried to modify the code in the pods.php file with this function

public function getPagination ( $label = 'Go to page:' ) {

        if ( Pod::$deprecated_notice ) {

        pods_deprecated( 'Pods::getPagination', '2.0', 'Pods::pagination' );
        $pod = pods( 'my_pod' );

        $params = array( 'limit' => 2 );

        $pod->find( $params ); 
    }

    echo $pods->pagination( array( 'type' => 'paginate');
}

I can't find the way to manage pagination directly in wordpress administration

Does your theme natively support the prev/next and pagination on the non custom post types? If it does, and you're using the Pods Auto Frontier Template plugin to identify the Pods Templates to show for your pods, then you only need to change the 'replace' option for the Single Detail screen to to 'after'. This will allow your theme to do most of it's work correctly and ONLY replace where the theme calls for Post Content.

If you are using a shortcode, you need to add the following two parameters to your shortcode:

  1. limit="##" and set this to the number of posts you want on a page, and
  2. pagination="true" , which will tell the template to honor pagination.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM