WordPress.org

Forums

Attachments
[resolved] Display only if post in particular category? (9 posts)

  1. Alec Rust
    Member
    Posted 2 years ago #

    Is there any way to display this Attachments box under the post only if the post resides within a particular category?

    http://wordpress.org/extend/plugins/attachments/

  2. Jonathan Christopher
    Member
    Plugin Author

    Posted 2 years ago #

    Yes, you can wrap your code in in_category().

  3. Alec Rust
    Member
    Posted 2 years ago #

    I'm aware I can do this in my template file, but the same doesn't seem to work within functions.php. I'd like to prevent the "Attachments" box from appearing under the post editor within the admin panel, unless the post is within a particular category.

  4. Jonathan Christopher
    Member
    Plugin Author

    Posted 2 years ago #

    Ah ha! I completely mis-read that, I apologize. I'm working on a number of location parameters not only for things like this but also taking into account a number of other possibilities (e.g. post ID, parent post ID, page template, etc) but those are not ready yet. Shooting for 3.5!

  5. Alec Rust
    Member
    Posted 2 years ago #

    No problem, poor wording on my part! Thanks for the info.

  6. karl19
    Member
    Posted 2 years ago #

    Being able to define which pages attachments should show on would be a great feature. Oftentimes we only use it for a couple of pages at most (sometimes only homepage), and it'd be useful to set it to only show on those few pages in the admin.

  7. Jonathan Christopher
    Member
    Plugin Author

    Posted 2 years ago #

    I absolutely agree, and am putting serious thought into the implementation because I very often want to get quite complex with my location rules. This feature is currently top on my list and will be included in version 3.5 as soon as it's ready!

  8. Jonathan Christopher
    Member
    Plugin Author

    Posted 2 years ago #

    I'm only marking this as resolved because it's more of a feature request as opposed to a support question, you can follow this feature's progress on GitHub:

    https://github.com/jchristopher/attachments/issues/41

  9. Jonathan Christopher
    Member
    Plugin Author

    Posted 2 years ago #

    I'm only marking this as resolved because it's more of a feature request as opposed to a support question, you can follow this feature's progress on GitHub:

    https://github.com/jchristopher/attachments/issues/41

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Attachments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.