• Resolved Kim Bydlon

    (@kbydlon)


    I am trying to use the slug that I’ve entered for a Media Category to view all of those photos or media items at one URL on the front end of my site, but when I try to navigate to that link, it doesn’t work. I would assume that a category with a slug of “stock-photos” would have a URL of https://[mywebsite].com/stock-photos. Similarly, would a child/subcategory with a slug of “seniors” be located at https://[mywebsite].com/stock-photos/seniors? Neither of these URL formats are working for me when I try to go to the links.

    Could it be because I don’t have a theme template page set up to display all the media in a category? Is that even possible? Even so, using the above strategy should display SOMETHING instead of “page cannot be found” error.

    Please help! Thanks in advance.

    • This topic was modified 1 year, 2 months ago by Kim Bydlon.
    • This topic was modified 1 year, 2 months ago by Kim Bydlon.
    • This topic was modified 1 year, 2 months ago by Kim Bydlon.
Viewing 1 replies (of 1 total)
  • Plugin Author optimole

    (@optimole)

    Hi @kbydlon,

    Indeed, you’ve pinpointed a common issue. As it stands, the category used for attachments isn’t configured to be public, meaning there aren’t public pages available to display items within the category. This is the reason why navigating to those URLs results in a “page cannot be found” error.

    Your intuition about the URLs is correct under normal circumstances. With most post types that are public, the URL structure you’re expecting (like https://[mywebsite].com/stock-photos or https://[mywebsite].com/stock-photos/seniors) would be accurate. However, the media and attachment post types in WordPress, by default, do not have archive pages that are publicly queryable. That’s something typically reserved for other post types like posts, pages, or custom post types that have the ‘has_archive’ parameter enabled.

    There are workarounds to achieve the functionality you’re looking for. You might consider creating a custom post type for your media items, or utilize plugins or custom code to make media categories publicly queryable and their items displayable on the front end of your website. Another option would be to create a gallery or portfolio page that’s dedicated to displaying media items based on their categories.

    I hope this clarification helps! If you need further assistance or guidance on how to implement these, feel free to reach out.

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot identify direct url for Media Category’ is closed to new replies.