Домой WordPress WordPress: Проблемы и решения Как навигацию страниц поставить выше информации автора и рейтинга?
5ответ(ов) в теме
Владимир
не в сети 7 лет
На сайте с 25.04.2016
Участник
1
08:28

Здравствуйте ! После подключения отображения информации об авторе и рейтинге, моя навигация страниц (в многостраничных статьях) опустилась ниже. Хотелось , чтобы навигация страниц отображалась сразу после статьи (перед информацией об авторе и рейтинге). Скрин как сейчас и как хотелось бы :

Вы не можете просматривать опубликованные ссылки

Навигация страниц вставляетя кодом

<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>
Может к этому коду надо что-то дописать , чтоб он поднялся под самую статью? Вставляя его в разные места файла страницы ничего не изменилось ( встаёт вниз). Файл страницы:
<?php
$post_defaults = array(
	'author'		=> '1',
	'published'		=> '1',
	'categories'	=> '1',
	'comment_info'	=> '1',
	'updated'		=> '1',
	'tags'			=> '1',
	'author_box'	=> '0',
	'post_nav'		=> '1',
	'comments'		=> '1',
);
$post_elements = frontier_option('post_elements', array());
$post_elements = wp_parse_args($post_elements, $post_defaults);

$page_defaults = array(
	'author'		=> '0',
	'published'		=> '0',
	'comment_info'	=> '0',
	'updated'		=> '0',
	'author_box'	=> '0',
	'comments'		=> '1',
);
$page_elements = frontier_option('page_elements', array());
$page_elements = wp_parse_args($page_elements, $page_defaults);
?>

<article id="post-<?php the_ID(); ?>" <?php post_class('single-view'); ?>>
<?php do_action('frontier_before_single_article'); ?>

<?php if ( is_active_sidebar('widgets_before_post') ) : ?><div id="widgets-wrap-before-post" class="cf"><?php dynamic_sidebar('widgets_before_post'); ?></div><?php endif; ?>

<header class="entry-header cf">
	<?php do_action('frontier_before_single_post_header'); ?>
	<h1 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
	<?php do_action('frontier_after_single_post_header'); ?>
</header>

<div class="entry-byline cf">
	<?php do_action('frontier_before_single_post_byline'); ?>

	<?php if ( ( is_singular(array('post','attachment')) && $post_elements['author'] == 1 ) || ( is_page() && $page_elements['author'] == 1 ) ) : ?>
		<div class="entry-author author vcard">
			<?php $frontier_post_author_url = get_the_author_meta('user_url') != '' ? get_the_author_meta('user_url') : get_author_posts_url( get_the_author_meta('ID') ); ?>
			<i class="genericon genericon-user"></i><a class="url fn" href="<?php echo esc_url( $frontier_post_author_url ); ?>"><?php the_author(); ?></a>
		</div>
	<?php endif; ?>

	<?php if ( ( is_singular(array('post','attachment')) && $post_elements['published'] == 1 ) || ( is_page() && $page_elements['published'] == 1 ) ) : ?>
		<div class="entry-date">
			<i class="genericon genericon-day"></i><a class="updated" href="<?php the_permalink(); ?>"><?php the_time(get_option('date_format')); ?></a>
		</div>
	<?php endif; ?>

	<?php if ( is_singular('post') && $post_elements['categories'] == 1 ) : ?>
		<div class="entry-categories">
			<i class="genericon genericon-category"></i><?php the_category(', '); ?>
		</div>
	<?php endif; ?>

	<?php if ( ( ( is_singular(array('post','attachment')) && $post_elements['comment_info'] == 1 ) || ( is_page() && $page_elements['comment_info'] == 1 ) ) && ( comments_open() || ( !comments_open() && get_comments_number() != 0 ) ) ) : ?>
		<div class="entry-comment-info">
			<i class="genericon genericon-comment"></i><a href="#comment-area"><?php comments_number( __('Comments', 'frontier'), __('1 Comment', 'frontier'), __('% Comments', 'frontier') ); ?></a>
		</div>
	<?php endif; ?>

	<?php edit_post_link( __('Edit', 'frontier'), '<i class="genericon genericon-edit"></i>' ); ?>

	<?php do_action('frontier_after_single_post_byline'); ?>
</div>

<div class="entry-content cf">
	<?php do_action('frontier_before_single_post_content'); ?>

	<?php if ( is_active_sidebar('widgets_before_post_content') ) : ?><div id="widgets-wrap-before-post-content" class="cf"><?php dynamic_sidebar('widgets_before_post_content'); ?></div><?php endif; ?>

	<?php the_content(); ?>


	<?php if ( is_active_sidebar('widgets_after_post_content') ) : ?><div id="widgets-wrap-after-post-content" class="cf"><?php dynamic_sidebar('widgets_after_post_content'); ?></div><?php endif; ?>

	<?php if ( is_attachment() && wp_attachment_is_image() ) : ?>
		<div class="attachment-nav cf">
			<?php $nav_image_size = apply_filters( 'frontier_prev_next_image_size', 0 ); ?>
			<div class="link-prev"><?php previous_image_link( $nav_image_size, __('← Previous Image', 'frontier') ); ?></div>
			<div class="link-next"><?php next_image_link( $nav_image_size, __('Next Image →', 'frontier') ); ?></div>
		</div>
	<?php endif; ?>

	<?php wp_pagenavi( array( 'type' => 'multipart' ) ); ?>

	<?php do_action('frontier_after_single_post_content'); ?>
</div>

<footer class="entry-footer cf">
	<?php do_action('frontier_before_single_post_footer'); ?>

	<?php if ( ( is_singular('post') && $post_elements['updated'] == 1 ) || ( is_page() && $page_elements['updated'] == 1 ) ) : ?>
		<div class="entry-updated updated">
			<?php printf( __( 'Updated: %1$s &mdash; %2$s', 'frontier' ), get_the_modified_date(), get_the_modified_time() ); ?><script type="text/javascript" src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js" charset="utf-8"></script>
<script type="text/javascript" src="//yastatic.net/share2/share.js" charset="utf-8"></script>
<div class="ya-share2" data-services="vkontakte,facebook,odnoklassniki,moimir,gplus,twitter,blogger,evernote,lj"></div>
		</div>
	<?php endif; ?>

	<?php if ( is_singular('post') && $post_elements['tags'] == 1 ) : ?>
		<div class="entry-tags"><?php the_tags(); ?></div>
	<?php endif; ?>

	<?php do_action('frontier_after_single_post_footer'); ?>
</footer>

<?php if ( is_active_sidebar('widgets_after_post') ) : ?><div id="widgets-wrap-after-post" class="cf"><?php dynamic_sidebar('widgets_after_post'); ?></div><?php endif; ?>

<?php do_action('frontier_after_single_article'); ?>
</article>

<?php if ( ( is_singular('post') && $post_elements['author_box'] == 1 ) || ( is_page() && $page_elements['author_box'] == 1 ) ) : ?>
	<div class="author-info">
		<?php
			$frontier_author_info = '<h4 class="title">' . __('The Author', 'frontier') . '</h4>';
			$frontier_author_info .= '<div class="author-avatar">' . get_avatar( get_the_author_meta('ID'), 64 ) . '</div>';
			$frontier_author_info .= '<div class="author-description"><h4>' . get_the_author_link() . '</h4>' . get_the_author_meta('description') . '</div>';
			echo apply_filters( 'frontier_author_info', $frontier_author_info );
		?>
	</div>
<?php endif; ?>

<?php if ( is_singular('post') && $post_elements['post_nav'] == 1 ) : ?>
	<div class="post-nav cf">
		<?php
			$prev_post = get_previous_post();
			$next_post = get_next_post();
			$post_nav_single = '';

			if ( !empty($prev_post) )
				$post_nav_single .= '<div class="link-prev"><a href="' . get_permalink( $prev_post->ID ) . '" title="' . esc_attr( $prev_post->post_title ) . '">' . __('← Previous Post', 'frontier') . '</a></div>';

			if ( !empty($next_post) )
				$post_nav_single .= '<div class="link-next"><a href="' . get_permalink( $next_post->ID ) . '" title="' . esc_attr( $next_post->post_title ) . '">' . __('Next Post →', 'frontier') . '</a></div>';
			
			echo apply_filters( 'frontier_post_nav_single', $post_nav_single );
		?>
	</div>
<?php endif; ?>

<?php if ( ( !is_page() && $post_elements['comments'] == 1 ) || ( is_page() && $page_elements['comments'] == 1 ) ) : ?>
	<?php do_action('frontier_before_comments'); ?>
		<div id="comment-area"><?php comments_template(); ?></div>
	<?php do_action('frontier_after_comments'); ?>
<?php endif; ?>

Помогите решить пожалуйста.

0
Вова (Otshelnik-Fm)
не в сети 15 часов
На сайте с 27.01.2013
Участник
Тем 43
Сообщения 18642
2
10:29

Блок автора выводится в контенте. Так как вы хотите не получится.

Вообще не вижу логичности - выводить кнопки а потом блок автора - что автор кнопок тот чей блок? Блок автора должен быть сразу после записи...

Блок автора выводится функцией rcl_author_info. Смотрите как там все устроено.

0
Владимир
не в сети 7 лет
На сайте с 25.04.2016
Участник
3
11:07

Otshelnik-Fm сказал(а)
Вообще не вижу логичности - выводить кнопки а потом блок автора - что автор кнопок тот чей блок?

Дело в том , что при написании длинных статей , их можно в редакторе разделить на страницы, чтобы не прокручивать длинную портянку. В данном случае навигация страниц относится именно к этой статье , которая разделена на части. Если ещё добавить "Материалы по теме", то эта навигация опускается ещё ниже от статьи , и читатель может её не увидеть и не прочитать продолжение.

Вы не можете просматривать опубликованные ссылки
0
Вова (Otshelnik-Fm)
не в сети 15 часов
На сайте с 27.01.2013
Участник
Тем 43
Сообщения 18642
4
11:15

а ну тогда понятно что за навигация... пробуйте увеличить значение приоритета фильтра

add_filter('the_content','rcl_author_info',70);
в файле публикации

0
Владимир
не в сети 7 лет
На сайте с 25.04.2016
Участник
5
17:03

Изменяя рейтинг в данной строчке удалось опустить информацию о авторе в самый низ страницы , но не ниже навигации. Моей целью был подьём навигации страницы под самое содержимое . Ответ на вопрос нашёл на странице поддержки плагина навигации . Плагин очень популярный (больше 1 млн. скачиваний) , поэтому пишу решение здесь , может ещё кому пригодится. Решение : нужно добавить в файл functions.php вашего шаблона следующий код -

function custom_pagination( $content ) {
if( is_singular() ) {
    $content .= wp_pagenavi( array( 'type' => 'multipart', 'echo' => false ) );
}
return $content;
}
add_filter( 'the_content','custom_pagination', 1 );

Это решение на странице поддержки плагина:

Вы не можете просматривать опубликованные ссылки
1
Тема закрыта. Публикация новых сообщений запрещена.