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
4ca6c2df
Commit
4ca6c2df
authored
Aug 22, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crop image
parent
9d85f2b0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
functions.php
wp-content/themes/nap/functions.php
+5
-5
No files found.
wp-content/themes/nap/functions.php
View file @
4ca6c2df
...
...
@@ -428,11 +428,11 @@ function nap_distinct_format_variations($variations) {
}
function
nap_image_resize
(
$image
,
$size
){
/*
function nap_image_resize($image,$size){
$ext = substr($image, strrpos($image, "."));
$url = substr($image, 0, strrpos($image, "."));
return $newimage = $url . "-".$size."x".$size. $ext;
}
}
*/
...
...
@@ -500,13 +500,13 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
if
(
!
in_array
(
$color
,
$temp_colors
))
{
$temp_colors
[]
=
$color
;
$nap_article
.=
'<li data-link = "'
.
get_permalink
(
$post_ID
)
.
nap_variation_url
(
$value
->
ID
)
.
'" data-image = "'
.
nap_image_resize
(
get_the_post_thumbnail_url
(
$value
->
ID
),
'200
'
)
.
'" data-color = "'
.
$color
.
'" data-format = "'
.
$format
.
'"></li> '
;
$nap_article
.=
'<li data-link = "'
.
get_permalink
(
$post_ID
)
.
nap_variation_url
(
$value
->
ID
)
.
'" data-image = "'
.
get_the_post_thumbnail_url
(
$value
->
ID
,
'thumbnail
'
)
.
'" data-color = "'
.
$color
.
'" data-format = "'
.
$format
.
'"></li> '
;
}
}
}
else
{
$nap_article
.=
'<li data-link = "'
.
get_permalink
(
$post_ID
)
.
'" data-image = "'
.
nap_image_resize
(
get_the_post_thumbnail_url
(
$value
->
ID
),
'200
'
)
.
'" data-color = "'
.
get_post_thumbnail_id
(
$post_ID
)
.
'" data-format = ""></li> '
;
$nap_article
.=
'<li data-link = "'
.
get_permalink
(
$post_ID
)
.
'" data-image = "'
.
get_the_post_thumbnail_url
(
$value
->
ID
,
'thumbnail
'
)
.
'" data-color = "'
.
get_post_thumbnail_id
(
$post_ID
)
.
'" data-format = ""></li> '
;
}
$nap_article
.=
'</ul>'
;
endif
;
...
...
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