-1

Can anyone suggest a good plugin-based, as opposed to template or theme-based, solution for the following that doesn't rely on shortcodes?

I have a plugin that creates a custom post type and four custom taxonomies.

The custom post type has the /songs slug.

The custom taxonomies have the following slugs:

/songs/genres
/songs/eras
/songs/venue
/songs/artists

My question is, how do I get the following URLs to show my custom content IN TABLE FORM without messing with custom templates or shortcodes?

/songs - show a table of all songs in the database sorted by song name
/songs/<song-name> - show a table of data connected to this song
/songs/genres - show a table of all genres in the database sorted by genre name
/songs/eras - show a table of all eras in the database sorted by era name
/songs/venue - show a table of all venues in the database sorted by venue name
/songs/artists - show a table of all artists in the database sorted by artist name
/songs/genres/<genre> - show a table of songs, sorted by name, with this genre
/songs/eras/<era> - show a table of songs, sorted by name, with this era
/songs/venue/<venues> - show a table of songs, sorted by name, with this venue
/songs/artists/<artist> - show a table of songs, sorted by name, with this artist

Example table I'd like on every page:

Song Name | Artist  | Genre  | Era  | Venue
--------------------------------------------
song1     | artist1 | genre1 | era1 | venue1
song2     | artist2 | genre2 | era2 | venue2

I've figured out how to do this using custom templates, but these templates won't work with all themes. The custom templates would have to be re-coded for any theme other than the one I'm using for development.

In my reading on this issue, I've come to understand that it's not a good idea to put design code into plugins. But, if this is the case, how can I be sure my custom content gets displayed appropriately across many different themes? I think what I'm missing is how custom post types and custom taxonomies can be portable across themes.

If I haven't provided enough information, let me know what more I need to share.

Thanks.

  • Can Mark Kaplun, Pieter Goosen, TheDeadMedic, mrwweb, or ialocin explain to me in more detail how this is off-topic? How else should I ask this. The reasoning for the hold question in order to learn more about writing custom post types and custom taxonomies in WordPress plugins? As a new person to this community, I find this kind of thing and the reason given for it to be off-putting, to say the least. – eyedarts Sep 5 '14 at 20:11
  • Tried to edit to fix the previous comment but it was past the 5 minute time limit Can Mark Kaplun, Pieter Goosen, TheDeadMedic, mrwweb, or ialocin explain to me in more detail how this is off-topic? How else should I ask this in order to learn more about writing custom post types and custom taxonomies in WordPress plugins? As a new person to this community, I find this kind of thing and the reason given for it to be off-putting, to say the least. – eyedarts Sep 5 '14 at 20:17
  • Hi! I think you got couple angles wrong, which skewed perception of your question. First, opening with "suggest / plugin-based" provokes knee-jerk looking-for-plugin impression. "I have trouble developing following solution..." would come across much better. Also your questions has excessive amount of detail, which drowns the conceptual part of it, which you actually looking to resolve. I am reopening, but would advise to edit it in light of this. :) – Rarst Sep 5 '14 at 22:02
  • I appreciate this. Thanks. I think those who judged this to be off-topic for that reason should actually read questions before marking them a certain way. Regarding the amount of detail ... I included as much detail as possible because I'm not sure what the main issue is, since my question deals with multiple issues. I guess if I already knew the answer to my question I'd be able to know exactly how much detail I should put into the question. I've also seen many questions that didn't have enough detail and I was attempting to avoid that situation. Thanks for opening it back up, though. – eyedarts Sep 5 '14 at 22:38
  • If you have multiple issues then ask multiple questions. :) – Rarst Sep 5 '14 at 22:47
0

The answer is that there is no way to do what I'm asking, at least, there's no simple/easy way. Pieter Goosen writes in their comment above:

Styling is theme territory, not plugins, and that is where your tables should be. The best possible solution is a shortcode if you need this to be in a plugin.

I would add to this that custom templates are also an option, but further blur the line between themes and plugins.

The WordPress documentation isn't clear on this. It seems to be a grey area.

WordPress allows us to create custom post types and custom taxonomies but because that data can be anything, there's no standardized way of using that data across themes other than to treat it like any other post, category, or tag ... even if the data doesn't make sense to be treated that way.

Aside: As a first time questioner, I'm disappointed by the regulars I've interacted with here so far and hope that my future questions are either answered/commented on by more open and welcoming folks or are not answered/commented on at all. I wish someone who had experience writing a plugin with similar functionality would've answered. But, since this is my first question and it is broad, it's likely my fault. It's another RTFM situation. :( I was hoping the WordPress developer community was more welcoming than that.

  • Just on your Aside. If I came across as being rude, sorry about that. As already pointed out by me and @Rarst, your question is way to broad. We have a one question per post policy. You had multiple issues here. These types of questions are usually ignored and left without an answer. To be honest, I don't answer questions with multiple issues. Read through help center and visit the tour page and read How to Ask to avoid your question/s being "ignored" in future. I hope you can put this behind you and be a constructive member of this site :-) – Pieter Goosen Sep 7 '14 at 12:36
  • 1
    Ok, thanks. I think it was confusing because of the initial reason the question was put on hold and the willingness for you all to comment but not attempt an answer. I appreciate your follow-up with me on this and will do my best to utilize the resources you mention here for future questions. – eyedarts Sep 7 '14 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.