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
13acf78d
Commit
13acf78d
authored
Aug 28, 2017
by
Nahla Shiri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
phototeque correction
parent
df08d75a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
129 additions
and
61 deletions
+129
-61
functions.php
wp-content/themes/nap/functions.php
+13
-53
phototheque.php
wp-content/themes/nap/phototheque.php
+113
-0
archive-product.php
wp-content/themes/nap/woocommerce/archive-product.php
+3
-8
No files found.
wp-content/themes/nap/functions.php
View file @
13acf78d
...
...
@@ -462,62 +462,20 @@ function nap_get_item($post_ID, $args = null, $current_page = '', $options = nul
}
}
/* if (isset($search['pa_couleur']) && $search['pa_couleur'] != '') {
$colors_value = get_the_terms($post_ID, 'pa_couleur');
$filter = "hidden";
if (is_array($colors_value)) {
foreach ($colors_value as $key => $value) {
$code = nap_color_attribute($value->slug);
if ($code != '' && stristr($search['pa_couleur'], $code)) {
$filter = "selected";
}
}
}
}
/*$attributes = array('Univers' => 'pa_univers', 'Matiére' => 'pa_matiere', 'Format' => 'pa_format', 'Couleurs' => 'pa_couleur');
foreach ($attributes as $key => $value) :
if($value = 'pa_couleur' )
$filter= nap_filter_attribute($post_ID,$search[$value],$value,true);
else
$filter= nap_filter_attribute($post_ID,$search[$value],$value);
endforeach; */
/* if (isset($search['pa_format']) && $search['pa_format'] != '') {
$format_value = get_the_terms($post_ID, 'pa_format');
$filter = "hidden";
if (is_array($format_value)) {
foreach ($format_value as $key => $value) {
if (stristr($search['pa_format'], $value->name)) {
$filter = "selected";
}
}
}
}
if (isset($search['pa_matiere']) && $search['pa_matiere'] != '') {
$format_value = get_the_terms($post_ID, 'pa_matiere');
$filter = "hidden";
if (is_array($format_value)) {
foreach ($format_value as $key => $value) {
if (stristr($search['pa_matiere'], $value->name)) {
$filter = "selected";
}
}
}
} */
if
(
isset
(
$filter
))
$class
=
$filter
;
$nap_article
=
'<article class = " visible row '
.
$class
.
'">
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="">'
;
}
else
{
$nap_img
=
$link
;
$nap_img
.=
'<img class="transition" src="'
.
$image
.
'" alt="" title="">'
;
}
$nap_article
=
'<article class = " visible row ">
<a href="#"></a>
<figure data-bg = "" class = "'
.
$size
.
' transition">
<div class="abs-full article-bg transition"></div>'
;
$nap_article
.=
$link
;
$nap_article
.=
'<img class="transition" src="'
.
$image
.
'" alt="" title="">'
;
$nap_article
.=
$nap_img
;
if
(
$current_page
==
'catalogue'
)
:
$nap_article
.=
'<ul class = "clearfix">'
;
$variations
=
get_posts
(
$args
);
...
...
@@ -690,11 +648,13 @@ function get_logged_user() {
echo
'<a class="login" href="#">accès pro</a>'
;
}
}
//remove margin top margin header Wordpress
add_action
(
'get_header'
,
'my_filter_head'
);
function
my_filter_head
()
{
remove_action
(
'wp_head'
,
'_admin_bar_bump_cb'
);
}
function
nap_attribute_by_category
(
$categorie
,
$attr
)
{
$args
=
array
(
...
...
wp-content/themes/nap/phototheque.php
0 → 100644
View file @
13acf78d
<?php
/**
* Template Name: phototheque
*
*/
$current_page
=
'phototheque'
;
?>
<div
id=
"phototheque"
class=
"clearfix container "
>
<div
class=
"phototheque-content"
>
<div
class=
"nav-phototeque container gray-bg row fixed"
>
<div
class=
"header"
>
<div
class =
"btn-wrapper row close-panel"
>
<div
class=
"pink-btn circle-btn"
><span
class =
"abs-center backlink"
>
Retour
</span></div>
</div>
<nav
class =
"row"
>
<h2
class =
"crete big-title"
>
Photothèque
</h2>
<?php
include
(
'nav-list.php'
);
?>
</nav>
</div>
</div>
<?php
$taxonomy
=
'product_cat'
;
$orderby
=
'id'
;
$show_count
=
0
;
// 1 for yes, 0 for no
$pad_counts
=
0
;
// 1 for yes, 0 for no
$hierarchical
=
1
;
// 1 for yes, 0 for no
$title
=
''
;
$empty
=
0
;
$args
=
array
(
'taxonomy'
=>
$taxonomy
,
'orderby'
=>
$orderby
,
'show_count'
=>
$show_count
,
'pad_counts'
=>
$pad_counts
,
'hierarchical'
=>
$hierarchical
,
'title_li'
=>
$title
,
'hide_empty'
=>
$empty
);
$all_categories
=
get_categories
(
$args
);
foreach
(
$all_categories
as
$cat
)
{
if
(
$cat
->
category_parent
==
0
)
{
$category_id
=
$cat
->
term_id
;
$args2
=
array
(
'taxonomy'
=>
$taxonomy
,
'child_of'
=>
0
,
'parent'
=>
$category_id
,
'orderby'
=>
$orderby
,
'show_count'
=>
$show_count
,
'pad_counts'
=>
$pad_counts
,
'hierarchical'
=>
$hierarchical
,
'title_li'
=>
$title
,
'hide_empty'
=>
$empty
);
$sub_cats
=
get_categories
(
$args2
);
?>
<div
class=
"gallery-wrapper right row"
>
<div
class=
"panel panel-content product-list transition clearfix list-animation"
>
<?php
if
(
$sub_cats
)
{
$i
=
0
;
foreach
(
$sub_cats
as
$sub_category
)
:
?>
<section
id =
"cat
<?php
echo
$i
?>
-
<?php
echo
$current_page
;
?>
"
>
<h2
class=
"crete small-title"
>
<?php
echo
$sub_category
->
name
?>
</h2>
<div
class=
"product-list"
>
<?php
$args
=
array
(
'post_type'
=>
'product'
,
'stock'
=>
1
,
'posts_per_page'
=>
-
1
,
'product_cat'
=>
$sub_category
->
name
,
'orderby'
=>
'title'
,
'order'
=>
'ASC'
);
$naps_posts
=
new
WP_Query
(
$args
);
$options
=
array
();
while
(
$naps_posts
->
have_posts
())
:
$naps_posts
->
the_post
();
$id
=
get_the_ID
();
$options
[
'size'
]
=
'big'
;
$options
[
'image'
]
=
$args
=
array
(
'post_type'
=>
array
(
'product'
,
'product_variation'
),
'post_status'
=>
array
(
'private'
,
'publish'
),
'numberposts'
=>
-
1
,
'orderby'
=>
'menu_order'
,
'order'
=>
'asc'
,
'post_parent'
=>
$id
);
echo
nap_get_item
(
$id
,
$args
,
$current_page
,
$options
);
endwhile
;
wp_reset_query
();
?>
</div>
</section>
<?php
$i
++
;
endforeach
;
}
?>
</div>
<!-- /product-list -->
</div>
<!-- /product-list -->
<?php
}
}
?>
</div>
</div>
wp-content/themes/nap/woocommerce/archive-product.php
View file @
13acf78d
...
...
@@ -83,16 +83,11 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
$filter_matiere
=
nap_selected_filter
(
$_GET
[
'pa_matiere'
],
$term
);
$filter_univers
=
nap_selected_filter
(
$_GET
[
'pa_univers'
],
$term
);
if
(
$value
==
'pa_univers'
)
{
$unv
=
get_term_by
(
'name'
,
$term
,
'pa_univers'
);
$termID
=
$term
->
term_id
;
$date_deb
=
get_field
(
'uv_date_debut'
,
'pa_univers_'
.
$unv
->
term_id
);
$date_fin
=
get_field
(
'uv_date_fin'
,
'pa_univers_'
.
$unv
->
term_id
);
}
?>
?>
<li
class=
"
<?php
echo
$filter_format
.
' '
.
$filter_matiere
.
' '
.
$filter_univers
;
?>
"
>
<?php
echo
$term
;
?>
</li>
<li
class=
"
<?php
echo
$filter_format
.
' '
.
$filter_matiere
.
' '
.
$filter_univers
?>
"
>
<?php
echo
$term
;
?>
</li>
<?php
endif
;
endforeach
;
foreach
(
array_unique
(
$colors
)
as
$name
=>
$code
)
{
...
...
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