Including Files Incrementally in Categories - WordPress
Posted: Wed Feb 06, 2008 9:48 am
(This is for a WordPress blog. Forgive me, I know almost nothing about PHP.)
I would like to include a different/new file for every post I make. In addition, the file that's included will be determined by the category that the post is in.
For example, I'd like to put a "Folder A" on my server with the files I want to include for "Category A": CatA-1.htm, CatA-2.htm, CatA-3.htm, etc. When I make the first post to that category, I would like it to automatically include CatA-1.htm. When I make the second post to that category, I'd like it to automatically include CatA-2.htm, etc. And then I would do the same thing for Category B and Category C, etc.
I do have different templates for different categories, and so I can simply insert the php code that I need for Category A into the Category A template file. However, I don't know what the php code should be.
How could I get the next file in the appropriate folder for the next post in that specific category? Doing it by Post ID wouldn't seem to work because you never know what the ID of the next post in a certain category will be. I haven't been able to find out if WordPress identifies posts in a category by some unique identifier that also relates to that category.
Any suggestions would be greatly appreciated.
I would like to include a different/new file for every post I make. In addition, the file that's included will be determined by the category that the post is in.
For example, I'd like to put a "Folder A" on my server with the files I want to include for "Category A": CatA-1.htm, CatA-2.htm, CatA-3.htm, etc. When I make the first post to that category, I would like it to automatically include CatA-1.htm. When I make the second post to that category, I'd like it to automatically include CatA-2.htm, etc. And then I would do the same thing for Category B and Category C, etc.
I do have different templates for different categories, and so I can simply insert the php code that I need for Category A into the Category A template file. However, I don't know what the php code should be.
How could I get the next file in the appropriate folder for the next post in that specific category? Doing it by Post ID wouldn't seem to work because you never know what the ID of the next post in a certain category will be. I haven't been able to find out if WordPress identifies posts in a category by some unique identifier that also relates to that category.
Any suggestions would be greatly appreciated.