The site I am building is kind of a site within a site, similar to how reddit has multiple subs for different topics.
I created a CPT for the topic in which i have 950+ and the option for more.
Each of these topics will have related posts such as articles, forums, etc. Some will be 1:M relationships, some will be M:M
I have meta box which allows me to select posts or define most of my M:M relations, but it does not help with post types created by other plugins like forums.
So my challenges:
1.) Is there a way to create a query argument to add “Where topic =$topic” for all defined post types? Or do i have to figure out how to edit each post type individually? Not sure how to do it for CPTS created by plugins that store the info in the database. (Do all custom post types get their own post loop?) Nor how to do this for CPTS created by other plugins. I imagine some sort of code block that inserts itself into the loop, but I dont know what functions to use.
Topics will be defined via urls with something like domain.exp/{topic}/articles (forums, videos, etc) or passed parameters for individual posts. (ie a blog may cover multiple topics, but those topics need to be considered for the proper ad displays related to the topic. , yet the topic itself would only have a blog/blog-slug url. So Id have to receive the topics a different way.
2) Is there a quick way to add a “Pick Topic” selector to all of the above post types including the plugin created ones?If i create the function, can that be inserted via code like, If post\_type = forum… insert Choose\_topic)
I know inserting it in the code itself would not work cause it’d be removed every time the plugin is updated, but i don’t know how to insert things otherwise or account for different tables.
This one little function is really holding back the entire progress of my site and I could use some help.
​
[ad_2]
Why isn’t “topic” a custom taxonomy, instead of a custom post type?