forked from studio-arrenberg/quartiersplattform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauthor.php
123 lines (88 loc) · 3.14 KB
/
author.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
if ( $curauth->ID == get_current_user_id() ) {
exit(wp_redirect( home_url().'/profil'));
}
get_header();
?>
<main id="site-content" class="page-grid <?php if (!has_post_thumbnail()) echo "no-single-header-image"; ?>" role="main">
<div class="left-sidebar">
<div class="hidden-small">
<?php
$args4 = array(
'post_type'=> array('projekte'),
'post_status'=>'publish',
'posts_per_page'=> 20,
'orderby' => 'date'
);
?>
<?php // card_list($args4); ?>
<?php projekt_carousel(); ?>
</div>
</div>
<div class="main-content">
<div class="profil-header">
<div class="profil-header-avatar">
<img class="" src="<?php echo get_avatar_url( $curauth->ID ) ?>" />
</div>
<!-- user name -->
<div class="profil-header-content">
<h1><?php echo $curauth->first_name." ".$curauth->last_name; ?></h1>
</div>
</div>
<?php
if ($curauth->ID == get_current_user_id()) {
?>
<a class="button" href="<?php echo get_site_url(); ?>/profil/"><?php _e('Mein Profil bearbeiten', 'quartiersplattform'); ?></a>
<?php
}
?>
<!-- Kontakt -->
<?php
$userid = "user_".$curauth->ID;
author_card(true, $curauth->ID, false);
?>
<br>
<!-- About -->
<?php if( get_field('about', $userid) ) { ?>
<h2><?php _e('Über mich', 'quartiersplattform'); ?> </h2>
<div><?php the_field('about', $userid); ?></div>
<br>
<?php } ?>
<?php
// Projekte
$args4 = array(
'post_type'=> array('projekte'),
'post_status'=>'publish',
'author' => $curauth->ID,
'posts_per_page'=> -1,
'order' => 'DESC',
'offset' => '0',
);
if (count_query($args4)) {
echo "<h2 class='margin-bottom'>".__("Projekte von",'quartiersplattform')." ".$curauth->first_name."</h2> <br>";
card_list($args4);
}
?>
<br>
<br>
<?php
$args4 = array(
'post_type'=> array('veranstaltungen', 'nachrichten','umfragen'),
'post_status'=>'publish',
'author' => $curauth->ID,
'posts_per_page'=> 20,
'order' => 'DESC',
'offset' => '0',
);
if (count_query($args4)) {
echo "<h2 class='margin-bottom'>".__("Beiträge von",'quartiersplattform')." ".$curauth->first_name."</h2> <br>";
card_list($args4);
}
?>
</div>
</div>
</div>
</main>
</div>
<?php get_footer(); ?>