前提・実現したいこと
ワードプレスのテーマ作成にて、コメント欄を設置したところ以下のエラーが出ましたが
解決方法がわかりません
発生している問題・エラーメッセージ
エラーメッセージ
Fatal error: Uncaught Error: Call to undefined function paginate_comments_links() in /Applications/MAMP/htdocs/wp/wp-content/themes/hotel/comments.php:23 Stack trace: #0 /Applications/MAMP/htdocs/wp/wp-includes/comment-template.php(1510): require() #1 /Applications/MAMP/htdocs/wp/wp-content/themes/hotel/single.php(28): comments_template() #2 /Applications/MAMP/htdocs/wp/wp-includes/template-loader.php(77): include('/Applications/M...') #3 /Applications/MAMP/htdocs/wp/wp-blog-header.php(19): require_once('/Applications/M...') #4 /Applications/MAMP/htdocs/index.php(17): require('/Applications/M...') #5 {main} thrown in /Applications/MAMP/htdocs/wp/wp-content/themes/hotel/comments.php on line 23
該当のソースコード
php
1sigle.php 2 3<?php get_header(); ?> 4 <div class="breadcrumbs"> 5 <span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="" href="http://example.com" class="home">HOME</a></span> > 6 <span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="" href="http://example.com">新着情報</a></span> > 7 <span typeof="v:Breadcrumb"><span property="v:title">お花見企画の予約を開始しました</span></span> 8 </div><!-- /.breadcrumbs --> 9 10 <div class="contentsWrap"> 11 <div class="mainContents"> 12 <?php 13 if(have_posts() ): 14 while( have_posts()): the_post(); 15 ?> 16 <article id="post-<?php the_ID(); ?>"<?php post_class('entry'); ?>> 17 <h1 class="type-A">新着情報</h1> 18 <h2 class="title type-B"><span><?php the_title(); ?></span></h2> 19 20 <div class="entryInfo"> 21 <div class="categories"> 22 <?php the_category(); ?> 23 </div> 24 <time datetime="<?php the_time('Y-m-d')?>"><?php the_time('Y年m月d日(l)')?></time> 25 </div><!-- /.entryInfo --> 26 27 <section class="content"> 28 <?php the_content(); ?> 29 </section><!-- /.content --> 30 <?php comments_template(); ?> 31 <nav class="postNavi"> 32 <span class="prev"><?php previous_post_link('%link'); ?></span> 33 <span class="next"><?php next_post_link('%link'); ?></span> 34 </nav> 35 </article><!-- /.entry --> 36 <?php 37 endwhile; 38 endif; 39 ?> 40 </div><!-- /.mainContents --> 41 42 <aside class="subContents"> 43 <div class="wrapper"> 44 <?php get_sidebar('categories'); ?> 45 <?php get_sidebar('archives'); ?> 46 </div><!-- /.wrapper --> 47 </aside><!-- /.subContents --> 48 </div><!-- /.contentsWrap --> 49<?php get_footer(); ?>
php
1comments.php 2<section class="comments"> 3<?php 4$comment_form_args = array( 5 'title_reply' => 'コメント投稿フォーム', 6 'comment_notes_after' => '', 7 ); 8comment_form( $comment_form_args ); 9if ( have_comments() ) : 10?> 11 <p><?php comments_number('コメントがありません。','コメントが1件あるよ', 'コメントが%件あります。'); ?></p> 12 <ol class="commentlist"> 13 <?php 14 $wp_list_commments_args = array( 15 'avatar_size' => '50' 16 ); 17 wp_list_comments($wp_list_commments_args ); 18 ?> 19 </ol> 20<?php 21 $paginate_comments_links_args = array( 22 'prev_text' => '←前のコメントページ', 23 'next_text' => '次のコメントページ', 24 ); 25 paginate_comments_links( $paginate_comments_links_args ); 26endif; 27?> 28</section><!-- /.comments --> 29
php
1 2functions.php 3 4<?php 5// アイキャッチ画像に使用する 6add_theme_support('post-thumbnails' ); 7 8// カスタムメニュー機能を利用可能 9add_theme_support('menus' ); 10 11 12?> 13
### 試したこと ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/18 04:41