Home › Forums › General Issues › Custom sidebar for both pages and posts › Reply To: Custom sidebar for both pages and posts
I edited the code in my question above.
I changed:
elseif( is_category() )
to:
elseif( is_category() || is_single() )
And so now it works for both pages and posts within a certain category, but not the categories themselves (the index/archive/category pages).
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.