Помогите с установкой WP-PostRatings

12
R1
На сайте с 26.10.2015
Offline
41
#11
SeVlad:

Вставка в content.php должна была вывести и в одиночной записи.
Ибо в single.php указан этот темплейт:
get_template_part( 'content', get_post_format() );

так то оно так, однако ж в одиночной записи рейтинга нет(

Вот код моего файла content.php


<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>

<?php if ( is_front_page() or is_category() or is_tag() or is_search() ) { ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-header">
<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
<?php
endif;

if ( is_single() ) :
the_title( '<div class="entry-title">', '</div>' );
else :
the_title( '<div class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></div>' );
endif;
?>
<div class="entry-meta">
<?php
if ( 'post' == get_post_type() )
twentyfourteen_posted_on();
edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
?>
</div><!-- .entry-meta -->
<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
</div><!-- .entry-header -->

<?php if ( is_search() ) : ?>
<div class="entry-summary">
<?php

$w = 230; $h = 300;
if ( kama_thumb_src() ) {
echo '<img src="'.kama_thumb_src('w='.$w.'&h='.$h).'" width="'.$w.'" height="'.$h.'" class="announce-img" alt="'.get_the_title().'" />';
}
?>
<?php
if ( get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true) ) {
echo get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true);
} else {
echo wp_trim_words(get_the_excerpt(), 20, '...');
}
?>

</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
$w = 230; $h = 300;
if ( kama_thumb_src() ) {
echo '<img src="'.kama_thumb_src('w='.$w.'&h='.$h).'" width="'.$w.'" height="'.$h.'" class="announce-img" alt="'.get_the_title().'" />';
}
?>
<?php
if ( get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true) ) {
echo get_post_meta(get_the_ID(), '_yoast_wpseo_metadesc', true);
} else {
echo wp_trim_words(get_the_excerpt(), 20, '...');
}
?>
</div><!-- .entry-content -->
<?php endif; ?>
<?php the_tags( '<div class="entry-meta"><span class="tag-links">', '', '</span></div>' ); ?>
</div><!-- #post-## -->

<?php } else { ?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php twentyfourteen_post_thumbnail(); ?>


<?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>

<?php
endif;

if ( is_single() ) :
the_title( '<h1 class="entry-title entry-header">', '</h1>' );
else :
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
endif;
?>

<div class="entry-meta">
<?php
if ( 'post' == get_post_type() )
twentyfourteen_posted_on();

edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
?>
</div><!-- .entry-meta -->

<?php if ( is_search() ) : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
/* translators: %s: Name of current post */
the_content( sprintf(
__( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ),
the_title( '<span class="screen-reader-text">', '</span>', false )
) );

wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
) );
?>
</div><!-- .entry-content -->
<?php endif; ?>

<?php the_tags( '<div class="entry-meta"><span class="tag-links">', '', '</span></div>' ); ?>
</article><!-- #post-## -->
<?php
if ( function_exists('related_posts') and is_single() ) {
ob_start();
related_posts();
$yarpp_content = ob_get_contents();
ob_end_clean();

$pos = strpos($yarpp_content, 'yarpp-related-none');

if (!$pos) echo $yarpp_content;
}
?>

<?php } ?>
Советские военные фильмы (https://kino-o-voine.ru)
SeVlad
На сайте с 03.11.2008
Offline
1609
#12
ruslan1012:
Вот код моего файла content.php

Подсказываю. Вставляя текст метки можно понять - работает ли и где.

Напр, свою функцию можно временно преобразовать во что-то типа такого:

<?php if(function_exists('the_ratings')) {echo "фурычит ".the_ratings(); } ?>
Делаю хорошие сайты хорошим людям. Предпочтение коммерческим направлениям. Связь со мной через http://wp.me/P3YHjQ-3.
12

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий