AnsPress_Breadcrumbs_Widget::breadcrumbs()

Description #

Output AnsPress breadcrumbs.

Source #

File: widgets/breadcrumbs.php

	public static function breadcrumbs() {
		$navs = self::get_breadcrumbs();

		echo '<ul class="ap-breadcrumbs clearfix">';
		echo '<li class="ap-breadcrumbs-home"><a href="' . esc_url( home_url( '/' ) ) . '" class="apicon-home"></a></li>';
		echo '<li><i class="apicon-chevron-right"></i></li>';

		$i         = 1;
		$total_nav = count( $navs );

		foreach ( $navs as $k => $nav ) {
			if ( ! empty( $nav ) ) {
				echo '<li>';
				echo '<a href="' . esc_url( $nav['link'] ) . '">' . esc_attr( $nav['title'] ) . '</a>';
				echo '</li>';

				if ( $total_nav !== $i ) {
					echo '<li><i class="apicon-chevron-right"></i></li>';
				}
			}
			++$i;
		}

		echo '</ul>';
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment