Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 在自定义页面模板上分页_Wordpress_Pagination - Fatal编程技术网

Wordpress 在自定义页面模板上分页

Wordpress 在自定义页面模板上分页,wordpress,pagination,Wordpress,Pagination,我不太懂wordpress。也许这是个愚蠢的问题 我创建了一个自定义页面,我的博客名。所有的博客帖子都被输入了。 我想问的是如何创建像这样的分页>和文章数量是由设置>阅读>博客页面显示最多。。。。邮局 这是我的密码 <div class="page-content"> <?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; $args_recent_posts = array(

我不太懂wordpress。也许这是个愚蠢的问题

我创建了一个自定义页面,我的博客名。所有的博客帖子都被输入了。 我想问的是如何创建像这样的分页>和文章数量是由设置>阅读>博客页面显示最多。。。。邮局

这是我的密码

<div class="page-content">
  <?php
    $paged = (get_query_var('page')) ? get_query_var('page') : 1;
    $args_recent_posts = array( 'post_type' => 'post', 'paged' => '$paged');
    $loop_recent_posts = new WP_Query( $args_recent_posts );
      if ( $loop_recent_posts->have_posts() ) :
        function the_excerpt_max_charlength($charlength)
          {
            $excerpt = get_the_excerpt();
            $charlength++;

            if ( strlen( $excerpt ) > $charlength )
              {
                $subex = mb_substr( $excerpt, 0, $charlength - 5 );
                $exwords = explode( ' ', $subex );
                $excut = - ( strlen( $exwords[ count( $exwords ) - 1 ] ) );

            if ( $excut < 0 )
              {
                 echo mb_substr( $subex, 0, $excut );
              }
            else
              {
                echo $subex;
              }
                echo '...';
              }
            else
              {
                echo $excerpt;
              }
          }  
      while ( $loop_recent_posts->have_posts() ) : $loop_recent_posts->the_post();
  ?>
  <div class="entry-item">
    <div class="entry-image-col1">
      <div class="ch-item chi-mg">
        <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'page-image-1' ); } ?>
        <div class="ch-info"> <a href="<?php the_permalink(); ?>" class="detail">See Full Post</a> </div>
      </div>
    </div>
    <div class="entry-info-col1">
      <div class="entry-meta">
        <div class="entry-date">
          <?php the_time('j M'); ?>
        </div>
        <div class="entry-author">Author : <span>
          <?php the_author_posts_link(); ?>
          </span></div>
        <span class="entry-comment">Comment : <span>
        <?php comments_number( 'no', 'one', '%' ); ?>
        </span></span> </div>
      <div class="entry-content">
        <div class="entry-title"><a href="<?php the_permalink(); ?>">
          <?php the_title(); ?>
          </a></div>
        <p><?php echo substr(get_the_excerpt(), 0,250); ?></p>
        <a href="<?php the_permalink(); ?>" class="link"><?php echo __( 'Read More &raquo;'); ?></a> </div>
    </div>
  </div>
   <?php endwhile; endif; wp_reset_query(); ?>
  <div class="navigation">
    <div class="alignleft">
      <?php next_posts_link('« Older Entries') ?>
    </div>
    <div class="alignright">
      <?php previous_posts_link('Newer Entries »') ?>
    </div>
  </div>
</div>

作者:
评论:

我希望有人能帮助我。
谢谢。

使用-它非常容易使用。

谁给我打了分,请你解释一下原因好吗?