Support

Account

Home Forums General Issues How to show field only in the selected category?

Solving

How to show field only in the selected category?

  • Hello I hope you can help me, as I can do to show field only in the selected category.

    Let’s say how the JOBS show only in category 1 and in the others hide. There is some way to achieve here my code, I hope your helps
    Thank you.

    <?php the_field( 'jobs', $this->post->ID);?>

  • Can someone please help me?

  • You need to check to see if what you’re showing is in the category, but you really don’t have enough information here for me to tell what you’re doing. Is this on a category archive page or a post in the archive?

    Basically

    
    if (/* Your condition to check if it's the right category here */) {
      the_field('jobs', $this->post->ID);
    }
    
  • Thanks for the reply, What I want is to show a field in a selected category, The field should appear in all the files, Pages and post of a selected category, Only the field in that category should appear.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.