How to check the terms in single custom post type template
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-events
Based on that i can display message.
Thank you All
custom-post-types custom-taxonomy taxonomy terms single
New contributor
add a comment |Â
up vote
1
down vote
favorite
I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-events
Based on that i can display message.
Thank you All
custom-post-types custom-taxonomy taxonomy terms single
New contributor
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-events
Based on that i can display message.
Thank you All
custom-post-types custom-taxonomy taxonomy terms single
New contributor
I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-events
Based on that i can display message.
Thank you All
custom-post-types custom-taxonomy taxonomy terms single
custom-post-types custom-taxonomy taxonomy terms single
New contributor
New contributor
New contributor
asked 2 hours ago
joe
83
83
New contributor
New contributor
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
If I understand you correctly, then has_term
should be solution for your problem...
if ( has_term( 'past-events', 'event_type' ) )
// do something
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
If I understand you correctly, then has_term
should be solution for your problem...
if ( has_term( 'past-events', 'event_type' ) )
// do something
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
add a comment |Â
up vote
2
down vote
accepted
If I understand you correctly, then has_term
should be solution for your problem...
if ( has_term( 'past-events', 'event_type' ) )
// do something
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
If I understand you correctly, then has_term
should be solution for your problem...
if ( has_term( 'past-events', 'event_type' ) )
// do something
If I understand you correctly, then has_term
should be solution for your problem...
if ( has_term( 'past-events', 'event_type' ) )
// do something
answered 44 mins ago
Krzysiek Dróà ¼dà ¼
11.8k42637
11.8k42637
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
add a comment |Â
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
Hi Krzysiek Dróà ¼dà ¼ Thanks for the answer that works fine.
â joe
18 mins ago
add a comment |Â
joe is a new contributor. Be nice, and check out our Code of Conduct.
joe is a new contributor. Be nice, and check out our Code of Conduct.
joe is a new contributor. Be nice, and check out our Code of Conduct.
joe is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fwordpress.stackexchange.com%2fquestions%2f316688%2fhow-to-check-the-terms-in-single-custom-post-type-template%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password