PluginProbe
Friends / 4.3.2
Friends v4.3.2
4.3.2 4.3.1 4.3.0 4.2.2 4.2.1 4.2.0 4.1.0 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.0 2.9.1 All 88 releases
friends / templates / frontend / index.php

index.php in Friends 4.3.2, at templates/frontend/index.php

76 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This is the main /friends/ template.
4 *
5 * @version 1.0
6 * @package Friends
7 */
8
9 Friends\Friends::template_loader()->get_template_part(
10 'frontend/header',
11 $args['post_format'],
12 $args
13 );
14
15 $show_welcome = isset( $args['show_welcome'] ) && $args['show_welcome'];
16
17 ?>
18 <section class="posts columns <?php echo 'collapsed' === $args['frontend_default_view'] ? ' all-collapsed' : ''; ?>">
19 <?php
20 if ( $show_welcome || ! have_posts() ) {
21 ?>
22 <div class="card columns col-12 friends-empty-state">
23 <div class="card-body">
24 <?php
25 if ( ! $show_welcome && $args['friends']->frontend->post_format ) {
26 $post_formats = get_post_format_strings();
27
28 if ( $args['friend_user'] ) {
29 echo esc_html(
30 sprintf(
31 // translators: %s is the name of an author.
32 __( '%1$s hasn\'t posted anything with the post format %2$s yet!', 'friends' ),
33 get_the_author(),
34 $post_formats[ $args['friends']->frontend->post_format ]
35 )
36 );
37 ?>
38 <a href="<?php echo esc_url( $args['friend_user']->get_local_friends_page_url() ); ?>"><?php esc_html_e( 'Remove post format filter', 'friends' ); ?></a>
39 <?php
40 } else {
41 echo esc_html(
42 sprintf(
43 // translators: %s is a post format title.
44 __( "Your friends haven't posted anything with the post format %s yet!", 'friends' ),
45 $post_formats[ $args['friends']->frontend->post_format ]
46 )
47 );
48 ?>
49 <a href="<?php echo esc_url( home_url( '/friends/' ) ); ?>"><?php esc_html_e( 'Remove post format filter', 'friends' ); ?></a>
50 <?php
51 }
52 } else {
53 $any_friends = Friends\User_Query::all_associated_users();
54 if ( ! $show_welcome && $any_friends->get_total() > 0 ) {
55 Friends\Friends::template_loader()->get_template_part( 'frontend/no-posts', $args['post_format'], $args );
56 } else {
57 Friends\Friends::template_loader()->get_template_part( 'frontend/no-friends', $args['post_format'], $args );
58 }
59 }
60 ?>
61 </div>
62 </div>
63 <?php
64 } else {
65 Friends\Frontend::have_posts();
66 the_posts_navigation();
67 }
68 ?>
69 </section>
70 <?php
71 Friends\Friends::template_loader()->get_template_part(
72 'frontend/footer',
73 $args['post_format'],
74 $args
75 );
76