How Can I Create Custom .php File for Specific Category
2 replies to this topic
Posted 25 March 2011 - 09:45 PM
I am trying to add unique content to the top of each of my category pages. There are a few different options I have thought of. 1. Create a custom .php file that is specific to the category. Not sure how to do this with platformpro because it looks like all the info is compiled into the template.postloop.php file. Is there a way to duplicate this and use the category ID number to add unique content to a specific category? 2. Create a page and have it pull the recent posts from a specific category. I only want to pursue this option if It is easy to have the post excerpts display the same way they actually do on the category pages, except they would obviously be displayed on the page I create. Using a page allows me to add all the unique content I want, I would just need to be able to pull the category posts automatically when new posts are added to that specific category and have them display the way platform pro does already. Does anyone one know the best option here and how to go about doing this. I have spent several hours pursing the best solution, Im just not sure how to do this with platform pro. I have done it with other themes, but am having trouble getting it to work here. Thanks for any help
Posted 25 March 2011 - 11:53 PM
The way you do this in PlatformPro is to use conditional tags (for example, is_category() ), either by adding code to functions.php and using hooks to place the code, or by adding the code directly to template.postloop.php. Once you've got the code to appear on only the pages you want it to, I find using jQuery to place the elements can be very useful. Give us an idea of more specific results you want us to achieve and we can help you through that. Check out these links.
Posted 26 March 2011 - 03:59 PM
Awesome Thanks Jimmy this worked like a charm. I hadn't ever done anything with conditional tags before. They make it super easy to customize any page to look exactly how you want it to look.