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
349939a3
Commit
349939a3
authored
Aug 03, 2017
by
imac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Merge]
parent
1bc53557
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
27 deletions
+63
-27
functions.php
wp-content/themes/nap/functions.php
+63
-27
No files found.
wp-content/themes/nap/functions.php
View file @
349939a3
...
...
@@ -290,7 +290,7 @@ function nap_menu() {
$menu
=
""
;
$taxonomy
=
'product_cat'
;
$orderby
=
'
title
'
;
$orderby
=
'
id
'
;
$show_count
=
0
;
$pad_counts
=
0
;
$hierarchical
=
1
;
...
...
@@ -316,7 +316,7 @@ function nap_menu() {
'taxonomy'
=>
$taxonomy
,
'child_of'
=>
0
,
'parent'
=>
$category_id
,
'orderby'
=>
$orderby
,
'orderby'
=>
'title'
,
'show_count'
=>
$show_count
,
'pad_counts'
=>
$pad_counts
,
'hierarchical'
=>
$hierarchical
,
...
...
@@ -597,5 +597,41 @@ function nap_save_general_proddata_custom_field( $post_id ) {
update_post_meta
(
$post_id
,
'_itf14_simple'
,
esc_attr
(
$text_itf14
)
);
}
}
//MS 2017-08-02 : Get referrer
function
externe_referrer
(
)
{
$url
=
$_SERVER
[
'HTTP_REFERER'
];
$postid
=
url_to_postid
(
$url
);
$ref
=
false
;
$uri
=
$_SERVER
[
'HTTP_HOST'
]
.
$_SERVER
[
'REQUEST_URI'
];
$pageWasRefreshed
=
isset
(
$_SERVER
[
'HTTP_CACHE_CONTROL'
])
&&
$_SERVER
[
'HTTP_CACHE_CONTROL'
]
===
'max-age=0'
;
if
(
$pageWasRefreshed
)
{
$postid
=
-
1
;
}
else
{
$postid
=
0
;
}
if
(
$postid
<
0
){
$ref
=
true
;
}
echo
$postid
;
if
(
$pageWasRefreshed
)
{
$postid
=
-
1
;
}
global
$post
;
$terms
=
get_the_terms
(
$post
->
ID
,
'product_cat'
);
foreach
(
$terms
as
$term
)
{
$product_cat_id
=
$term
->
term_id
;
echo
'prod_eeeeee === '
.
$product_cat_id
;
break
;
return
$ref
;
}
}
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