• 0
Sign in to follow this  
Followers 0

How Can I Create Custom .php File for Specific Category

Question

Posted · Report post

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

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Posted · Report post

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. http://codex.wordpress.org/Conditional_Tags http://www.pagelines.com/docs/base-child-theme

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0