How to check the terms in single custom post type template

The name of the pictureThe name of the pictureThe name of the pictureClash 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










share|improve this question







New contributor




joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    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










    share|improve this question







    New contributor




    joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      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










      share|improve this question







      New contributor




      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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






      share|improve this question







      New contributor




      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 2 hours ago









      joe

      83




      83




      New contributor




      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          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






          share|improve this answer




















          • Hi Krzysiek Dróżdż Thanks for the answer that works fine.
            – joe
            18 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "110"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          joe is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          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






























          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






          share|improve this answer




















          • Hi Krzysiek Dróżdż Thanks for the answer that works fine.
            – joe
            18 mins ago














          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






          share|improve this answer




















          • Hi Krzysiek Dróżdż Thanks for the answer that works fine.
            – joe
            18 mins ago












          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






          share|improve this answer












          If I understand you correctly, then has_term should be solution for your problem...



          if ( has_term( 'past-events', 'event_type' ) ) 
          // do something







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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
















          • 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










          joe is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          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.













           


          draft saved


          draft discarded














          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













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery