# friends/2.7.4/templates/frontend/index.php

Friends, version 2.7.4. 74 lines.

- Page: https://pluginprobe.com/plugins/friends/2.7.4/code/templates/frontend/index.php
- Raw: https://pluginprobe.com/plugins/friends/2.7.4/raw/templates/frontend/index.php
- Modified: 2023-07-23T07:15:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/friends/2.7.4/code/templates/frontend/index.php#L10-L20`.

```php
<?php
/**
 * This is the main /friends/ template.
 *
 * @version 1.0
 * @package Friends
 */

Friends\Friends::template_loader()->get_template_part(
	'frontend/header',
	null,
	$args
);

?>
<section class="posts columns translator-exclude<?php echo 'collapsed' === $args['frontend_default_view'] ? ' all-collapsed' : ''; ?>">
	<?php
	if ( ! have_posts() ) {
		?>
		<div class="card columns col-12">
			<div class="card-body">
			<?php
			if ( $args['friends']->frontend->post_format ) {
				$post_formats = get_post_format_strings();

				if ( $args['friend_user'] ) {
					echo esc_html(
						sprintf(
						// translators: %s is the name of an author.
							__( '%1$s hasn\'t posted anything with the post format %2$s yet!', 'friends' ),
							get_the_author(),
							$post_formats[ $args['friends']->frontend->post_format ]
						)
					);
					?>
					<a href="<?php echo esc_url( $args['friend_user']->get_local_friends_page_url() ); ?>"><?php esc_html_e( 'Remove post format filter', 'friends' ); ?></a>
					<?php
				} else {
					echo esc_html(
						sprintf(
						// translators: %s is a post format title.
							__( "Your friends haven't posted anything with the post format %s yet!", 'friends' ),
							$post_formats[ $args['friends']->frontend->post_format ]
						)
					);
					?>
					<a href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><?php esc_html_e( 'Remove post format filter', 'friends' ); ?></a>
					<?php
				}
			} else {
				$any_friends = Friends\User_Query::all_associated_users();
				if ( $any_friends->get_total() > 0 ) {
					Friends\Friends::template_loader()->get_template_part( 'frontend/no-posts' );
				} else {
					Friends\Friends::template_loader()->get_template_part( 'frontend/no-friends' );
				}
			}
			?>
			</div>
		</div>
		<?php
	} else {
		Friends\Frontend::have_posts();
		the_posts_navigation();
	}
	?>
</section>
<?php
Friends\Friends::template_loader()->get_template_part(
	'frontend/footer',
	null,
	$args
);

```
