Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
NAP-wordpress
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marwa Sfari
NAP-wordpress
Commits
9a8e881c
Commit
9a8e881c
authored
Aug 28, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Affichage phototèque
parent
cf42abfc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
functions.php
wp-content/themes/nap/functions.php
+16
-2
No files found.
wp-content/themes/nap/functions.php
View file @
9a8e881c
...
@@ -463,8 +463,22 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
...
@@ -463,8 +463,22 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
}
}
if
(
$current_page
==
'phototheque'
){
if
(
$current_page
==
'phototheque'
){
$nap_img
=
' <a class = "circle-btn download-btn hidden-elem" download href="'
.
get_the_post_thumbnail_url
(
$post_ID
,
'full'
)
.
'"></a>'
;
$nap_img
.=
'<img class="transition" src="'
.
get_the_post_thumbnail_url
(
$post_ID
,
'thumbnail'
)
.
'" alt="" title="">'
;
$img
=
''
;
if
(
has_post_thumbnail
(
$post_ID
))
{
$prod_image
=
get_the_post_thumbnail_url
(
$post_ID
,
'thumbnail'
);
$prod_hd
=
get_the_post_thumbnail_url
(
$post_ID
,
'full'
);
}
else
{
$product
=
new
WC_Product_Variable
(
$post_ID
);
$variations
=
$product
->
get_available_variations
();
if
(
isset
(
$variations
[
0
]))
{
$prod_image
=
get_the_post_thumbnail_url
(
$variations
[
0
][
'variation_id'
],
'thumbnail'
);
$prod_hd
=
get_the_post_thumbnail_url
(
$variations
[
0
][
'variation_id'
],
'full'
);
}
}
$nap_img
=
' <a class = "circle-btn download-btn hidden-elem" download href="'
.
$prod_hd
.
'"></a>'
;
$nap_img
.=
'<img class="transition" src="'
.
$prod_image
.
'" alt="'
.
get_the_title
(
$post_ID
)
.
'" title="'
.
get_the_title
(
$post_ID
)
.
'">'
;
}
}
else
else
{
{
...
...
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