PHP Include file based on category name
-
I am making a custom widget sidebar. I have a conditional statement that shows a list of recent posts based on the category. Below that, I would like to include a list of resources based in a file. The file is the same name as the category. How do I call the file in the PHP include() code so that it grabs the current category name?
I’ve tried something like
<?php include("https://www.website.com/$category.inc"); ?>
but it didn’t work.THANKS!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘PHP Include file based on category name’ is closed to new replies.