PluginProbe
Friends / 4.3.1
Friends v4.3.1
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 / twitter / frontend / index.php

index.php in Friends 4.3.1, at templates/twitter/frontend/index.php

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