Support

Account

Home Forums Backend Issues (wp-admin) Conditional for Post Category?

Solved

Conditional for Post Category?

  • I’m sorry if I’m missing something really obvious. I tried to search for an answer but couldn’t find anything.

    I have two post categories, Blog and News, a fairly typical setup. On my category archive page I just want to have an image show at the top based on which category the person is looking at. I have that code working, the problem I’m running into is the back-end conditional settings.

    The *only* way I could get the custom field options to show up on the Category edit page (ie, where you type in the actual archive intro text, description, etc for that specific category taxonomy) was to set a blanket conditional of User = Admin. Obviously this isn’t what I want because it’s showing the new field options everywhere. I tried setting it to the specific post category, to the taxonomy, post type = posts AND post category = blog, etc. I’m really not sure how to make it so those options only show on my category page specifically. Any help would be appreciated! Thank you!

  • Have you tried using just the post category = blog part of the location rules.

  • Yes, that’s one of the first ones I tried as that seemed the most logical choice. I just tested it again to be sure with a new test field group and it’s still not working.

    I’m running Genesis Framework with a couple of plugins but nothing that I can imagine would conflict with the back-end stuff to this degree.

  • Just our of curiosity, try adding the location rule like I said above, then edit a post, select the “blog” category and update the post. After doing that does the field group appear?

  • I can see the custom field on the individual posts, but what I’m trying to do is allow for the image to be added to the category archive page (the listing of all the blog posts, and all of the news posts). The client plans on regularly changing out a ‘banner’ image of the archive pages with promo banners and such so I was trying to come up with an easy solution for them to update that graphic. (I can get you some screenshots if this is confusing)

    If you go into Posts -> Categories -> And then edit an actual category.. that’s the page I’m trying to add the option to. I’m thinking maybe the conditionals just won’t allow for that kind of narrowing down.

    If this can’t be done this way, I can always pick up the pro version and try and make an options page to control it, I just don’t have a lot of extra cash right now and was trying to find a more affordable solution. I was thinking about getting the pro version anyhow, just *after* I got paid for this project. 😉

    Thank you for the help!

  • okay, I’m seeing now. You want to have this on just when editing the category named “blog” There aren’t any location rules built in to ACF that will do this.

    I previously posted a solution for adding a custom location to ACF to do this http://support.advancedcustomfields.com/forums/topic/custom-field-for-specific-category/

  • Awesome, thanks! I’ll check that out! Much appreciated. 🙂

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

The topic ‘Conditional for Post Category?’ is closed to new replies.