WordPress.org

Ready to get started?Download WordPress

Forums

Including Files Incrementally Based on Categories (2 posts)

  1. trivum
    Member
    Posted 6 years ago #

    I've looked around for an answer, but I can't find anything that seems to do the trick.

    I would like to include a file in a single post page based on the category. In addition, I'd like to include a new file every time a new post is made.

    For example, I'd like to put a folder on my server with the files I want to include: file-1.htm, file-2.htm, file-3.htm, etc. When I make the first post to that category, I would like it to automatically include file-1.htm. When I make the second post to that category, I'd like it to automatically include file-2.htm, etc.

    I have the problem of templates for different categories worked out, so I can simply insert the php code that I need for that category into that template file. However, I don't know what the php code should be.

    How can you get the next file in the folder for the next post in the category? Doing it by Post ID wouldn't seem to work because you never know what the next post in certain category will be. Is there some other identifier in the category that would label it as 1st, 2nd, 3rd, etc.?

    Thanks for any suggestions.

  2. trivum
    Member
    Posted 6 years ago #

    Anyone with ideas for this? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic