WordPress.org

Support

Support » Plugins and Hacks » My Post Order » [Resolved] change number of posts per page

[Resolved] change number of posts per page

Viewing 4 replies - 1 through 4 (of 4 total)
  • It’s ok.. i found the answer in another question. Thx 🙂

    Plugin Author Kapil Chugh

    @kapilchugh

    You are always welcome 🙂

    @sorcrr can you tell me ? thanks

    @joynic replace function from includes/functions.php

    function mpo_change_limit( $limit ) {
        global $paged, $myOffset, $wp_query;
        $section_name = isset($wp_query->query_vars['section_name']) ? $wp_query->query_vars['section_name'] : '';
        if ($section_name != '' ) {
          if (empty($paged)) {
            $paged = 1;
          }
          $postperpage = isset($wp_query->query_vars['posts_per_page']) ? $wp_query->query_vars['posts_per_page'] : intval(get_option('posts_per_page'));
          $pgstrt = ((intval($paged) -1) * $postperpage) + $myOffset . ', ';
          $limit = 'LIMIT ' . $pgstrt . $postperpage;
        }
        return $limit;
      }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] change number of posts per page’ is closed to new replies.
Skip to toolbar