beans_comments_navigation

Echo comments navigation.

beans_comments_navigation( )

Return: (void)

Source

function beans_comments_navigation() {

	if ( get_comment_pages_count() <= 1 && ! get_option( 'page_comments' ) ) {
		return;
	}

	beans_open_markup_e( 'beans_comments_navigation', 'ul', array(
		'class' => 'uk-pagination',
		'role'  => 'navigation',
	) );

		// Previous.
		if ( get_previous_comments_link() ) {

			beans_open_markup_e( 'beans_comments_navigation_item[_previous]', 'li', array( 'class' => 'uk-pagination-previous' ) );

				$previous_icon = beans_open_markup( 'beans_previous_icon[_comments_navigation]', 'i', array(
					'class' => 'uk-icon-angle-double-left uk-margin-small-right',
				) );
				$previous_icon .= beans_close_markup( 'beans_previous_icon[_comments_navigation]', 'i' );

				echo get_previous_comments_link(
					$previous_icon . beans_output( 'beans_previous_text[_comments_navigation]', __( 'Previous', 'tm-beans' ) )
				);

			beans_close_markup_e( 'beans_comments_navigation_item[_previous]', 'li' );

		}

		// Next.
		if ( get_next_comments_link() ) {

			beans_open_markup_e( 'beans_comments_navigation_item[_next]', 'li', array( 'class' => 'uk-pagination-next' ) );

				$next_icon = beans_open_markup( 'beans_next_icon[_comments_navigation]', 'i', array(
					'class' => 'uk-icon-angle-double-right uk-margin-small-right',
				) );
				$next_icon .= beans_close_markup( 'beans_previous_icon[_comments_navigation]', 'i' );

				echo get_next_comments_link(
					beans_output( 'beans_next_text[_comments_navigation]', __( 'Next', 'tm-beans' ) ) . $next_icon
				);

			beans_close_markup_e( 'beans_comments_navigation_item_[_next]', 'li' );

		}

	beans_close_markup_e( 'beans_comments_navigation', 'ul' );

}