Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Adullact
Theme-WordPress-Adullact-org
Commits
ea963684
Commit
ea963684
authored
Jun 20, 2019
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: formatting members list
parent
4ea4fc19
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
246 additions
and
74 deletions
+246
-74
category-21.php
category-21.php
+45
-16
category-27.php
category-27.php
+44
-16
category-28.php
category-28.php
+44
-16
category-29.php
category-29.php
+44
-16
functions.php
functions.php
+37
-10
style.css
style.css
+32
-0
No files found.
category-21.php
View file @
ea963684
<?php
$maxMembersPerLine
=
3
;
get_header
();
...
...
@@ -8,41 +10,68 @@ get_header();
<ul>
<?php
$order
=
"asc"
;
childrens_of_member_category
();
$order
=
"asc"
;
$currentCategoryID
=
explode
(
"="
,
$_SERVER
[
'REQUEST_URI'
])[
1
];
$category
=
get_the_category_by_id
(
$currentCategoryID
);
if
(
isset
(
$_GET
[
"order"
])){
if
(
isset
(
$_GET
[
"order"
]))
{
$order
=
$_GET
[
"order"
];
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
){
$order
=
"asc"
;
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
)
{
$order
=
"asc"
;
}
}
global
$post
;
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
egory_name'
=>
'adherent'
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
'
=>
$currentCategoryID
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
?>
<?php
//echo "url : " . $_SERVER['REQUEST_URI'];
$myposts
=
get_posts
(
$args
);
echo
"<br>"
;
$count
=
0
;
childrens_of_member_category
(
$category
);
echo
"<div class='adullact-members-list'>"
;
echo
"<div class='adullact-line'>"
;
foreach
(
$myposts
as
$post
)
:
setup_postdata
(
$post
);
$id
=
get_the_id
();
$url
=
get_metadata
(
"post"
,
$id
,
"project_url"
)[
0
];
$count
+=
1
;
?>
<li>
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
</li>
<?php
endforeach
;
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
class=
"adullact-member"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
<?php
if
(
$count
>=
$maxMembersPerLine
)
{
$count
=
0
;
echo
"</div>"
;
echo
"<div class='adullact-line'>"
;
}
endforeach
;
echo
"</div></div>"
;
wp_reset_postdata
();
?>
</ul>
...
...
category-27.php
View file @
ea963684
<?php
$maxMembersPerLine
=
3
;
get_header
();
...
...
@@ -8,41 +10,67 @@ get_header();
<ul>
<?php
$order
=
"asc"
;
childrens_of_member_category
();
$order
=
"asc"
;
$currentCategoryID
=
explode
(
"="
,
$_SERVER
[
'REQUEST_URI'
])[
1
];
$category
=
get_the_category_by_id
(
$currentCategoryID
);
childrens_of_member_category
(
$category
);
if
(
isset
(
$_GET
[
"order"
])){
if
(
isset
(
$_GET
[
"order"
]))
{
$order
=
$_GET
[
"order"
];
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
){
$order
=
"asc"
;
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
)
{
$order
=
"asc"
;
}
}
global
$post
;
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
egory_name'
=>
'epci-mutualisant'
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
'
=>
$currentCategoryID
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
?>
<?php
//echo "url : " . $_SERVER['REQUEST_URI'];
$myposts
=
get_posts
(
$args
);
echo
"<br>"
;
$count
=
0
;
echo
"<div class='adullact-members-list'>"
;
echo
"<div class='adullact-line'>"
;
foreach
(
$myposts
as
$post
)
:
setup_postdata
(
$post
);
$id
=
get_the_id
();
$url
=
get_metadata
(
"post"
,
$id
,
"project_url"
)[
0
];
$count
+=
1
;
?>
<li>
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
</li>
<?php
endforeach
;
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
class=
"adullact-member"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
<?php
if
(
$count
>=
$maxMembersPerLine
)
{
$count
=
0
;
echo
"</div>"
;
echo
"<div class='adullact-line'>"
;
}
endforeach
;
echo
"</div></div>"
;
wp_reset_postdata
();
?>
</ul>
...
...
category-28.php
View file @
ea963684
<?php
$maxMembersPerLine
=
3
;
get_header
();
...
...
@@ -8,41 +10,67 @@ get_header();
<ul>
<?php
$order
=
"asc"
;
childrens_of_member_category
();
$order
=
"asc"
;
$currentCategoryID
=
explode
(
"="
,
$_SERVER
[
'REQUEST_URI'
])[
1
];
$category
=
get_the_category_by_id
(
$currentCategoryID
);
childrens_of_member_category
(
$category
);
if
(
isset
(
$_GET
[
"order"
])){
if
(
isset
(
$_GET
[
"order"
]))
{
$order
=
$_GET
[
"order"
];
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
){
$order
=
"asc"
;
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
)
{
$order
=
"asc"
;
}
}
global
$post
;
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
egory_name'
=>
'ville'
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
'
=>
$currentCategoryID
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
?>
<?php
//echo "url : " . $_SERVER['REQUEST_URI'];
$myposts
=
get_posts
(
$args
);
echo
"<br>"
;
$count
=
0
;
echo
"<div class='adullact-members-list'>"
;
echo
"<div class='adullact-line'>"
;
foreach
(
$myposts
as
$post
)
:
setup_postdata
(
$post
);
$id
=
get_the_id
();
$url
=
get_metadata
(
"post"
,
$id
,
"project_url"
)[
0
];
$count
+=
1
;
?>
<li>
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
</li>
<?php
endforeach
;
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
class=
"adullact-member"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
<?php
if
(
$count
>=
$maxMembersPerLine
)
{
$count
=
0
;
echo
"</div>"
;
echo
"<div class='adullact-line'>"
;
}
endforeach
;
echo
"</div></div>"
;
wp_reset_postdata
();
?>
</ul>
...
...
category-29.php
View file @
ea963684
<?php
$maxMembersPerLine
=
3
;
get_header
();
...
...
@@ -8,41 +10,67 @@ get_header();
<ul>
<?php
$order
=
"asc"
;
childrens_of_member_category
();
$order
=
"asc"
;
$currentCategoryID
=
explode
(
"="
,
$_SERVER
[
'REQUEST_URI'
])[
1
];
$category
=
get_the_category_by_id
(
$currentCategoryID
);
childrens_of_member_category
(
$category
);
if
(
isset
(
$_GET
[
"order"
])){
if
(
isset
(
$_GET
[
"order"
]))
{
$order
=
$_GET
[
"order"
];
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
){
$order
=
"asc"
;
if
(
$order
!=
"asc"
&&
$order
!=
"desc"
)
{
$order
=
"asc"
;
}
}
global
$post
;
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
egory_name'
=>
'association'
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
$args
=
array
(
'posts_per_page'
=>
10
,
'offset'
=>
0
,
'cat
'
=>
$currentCategoryID
,
'orderby'
=>
'title'
,
'order'
=>
$order
);
?>
<?php
//echo "url : " . $_SERVER['REQUEST_URI'];
$myposts
=
get_posts
(
$args
);
echo
"<br>"
;
$count
=
0
;
echo
"<div class='adullact-members-list'>"
;
echo
"<div class='adullact-line'>"
;
foreach
(
$myposts
as
$post
)
:
setup_postdata
(
$post
);
$id
=
get_the_id
();
$url
=
get_metadata
(
"post"
,
$id
,
"project_url"
)[
0
];
$count
+=
1
;
?>
<li>
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
</li>
<?php
endforeach
;
<a
href=
"
<?php
echo
$url
;
?>
"
target=
"_blank"
class=
"adullact-member"
>
<?php
the_post_thumbnail
(
array
(
"200"
,
"200"
));
?>
<br>
<?php
the_title
();
?>
<br>
<?php
the_tags
(
$before
=
''
);
?>
</a>
<?php
if
(
$count
>=
$maxMembersPerLine
)
{
$count
=
0
;
echo
"</div>"
;
echo
"<div class='adullact-line'>"
;
}
endforeach
;
echo
"</div></div>"
;
wp_reset_postdata
();
?>
</ul>
...
...
functions.php
View file @
ea963684
...
...
@@ -8,24 +8,31 @@ function my_theme_enqueue_styles()
}
function
childrens_of_member_category
()
function
childrens_of_member_category
(
$category
)
{
//cette fonction affiche la liste des catégories enfants de la catégorie mère Adhérent
$childrens
=
get_term_children
(
21
,
"category"
);
//contiendra les id de tous les enfants de adhérent
if
(
$category
==
"Adhérent"
)
{
echo
" <a href='?cat=21' class='adullact-sort-button adullact-selected'>Tout</a>"
;
}
else
{
echo
" <a href='?cat=21' class='adullact-sort-button'>Tout</a>"
;
}
?>
<a
href=
'?cat=21'
>
Tout
</a>
<?php
foreach
(
$childrens
as
$c
)
{
$category
=
get_category
(
$c
);
//objet contenant les infos de la catégorie enfant
$
temp_
category
=
get_category
(
$c
);
//objet contenant les infos de la catégorie enfant
?>
<a
href=
'?cat=
<?php
echo
$c
;
?>
'
>
<?php
echo
$category
->
name
;
?>
<a
href=
'?cat=
<?php
echo
$c
;
?>
'
class=
"adullact-sort-button
<?php
if
(
$temp_category
->
name
==
$category
)
{
echo
"adullact-selected"
;
}
?>
"
>
<?php
echo
$temp_category
->
name
;
?>
</a>
...
...
@@ -44,13 +51,33 @@ function childrens_of_member_category()
function
sort_page
()
{
$link
=
explode
(
"&order"
,
$_SERVER
[
'REQUEST_URI'
])[
0
]
?>
$link
=
$_SERVER
[
'REQUEST_URI'
];
$cleanLink
=
explode
(
"&order"
,
$link
)[
0
];
if
(
strpos
(
$link
,
"order=desc"
))
{
?>
<a
href=
"
<?php
echo
$cleanLink
;
?>
&order=asc"
class=
"adullact-sort-button"
>
Croissant
</a>
<a
href=
"
<?php
echo
$cleanLink
;
?>
&order=desc"
class=
"adullact-sort-button adullact-selected"
>
Décroissant
</a>
<?php
}
else
{
?>
<a
href=
"
<?php
echo
$cleanLink
;
?>
&order=asc"
class=
"adullact-sort-button adullact-selected"
>
Croissant
</a>
<a
href=
"
<?php
echo
$cleanLink
;
?>
&order=desc"
class=
"adullact-sort-button"
>
Décroissant
</a>
<?php
}
<a
href=
"
<?php
echo
$link
;
?>
&order=asc"
>
Croissant
</a>
<a
href=
"
<?php
echo
$link
;
?>
&order=desc"
>
Décroissant
</a>
<?php
}
?>
\ No newline at end of file
style.css
View file @
ea963684
...
...
@@ -7,3 +7,35 @@
Template: twentyseventeen
Version: 0.8
*/
.adullact-members-list
{
display
:
flex
;
flex-direction
:
column
;
margin-top
:
30px
;
}
.adullact-line
{
display
:
flex
;
flex-direction
:
row
;
justify-content
:
flex-start
;
}
.adullact-member
{
max-width
:
200px
;
word-wrap
:
break-spaces
;
text-align
:
center
;
}
.adullact-sort-button
{
padding
:
5px
;
border-radius
:
3px
;
border
:
1px
solid
grey
;
color
:
grey
;
margin
:
7px
;
}
.adullact-selected
{
color
:
black
;
border
:
1px
solid
black
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment