Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to use PHP in some posts. These posts should look like normal posts, be in the archive and categories like normal posts an have tags.

I don't need PHP in every post, but it would be great if I could use it in some.

I saw that it is possible to create custom page templates which seems to be almost what I want, but I want it for posts. How can I get it?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

You can edit the single.php and/or content-single.php files in your theme.

Then it depends what you mean by "some". You could apply some conditions to your code (only certain categories, certain tags, certain specific post IDs only, etc.)

You could also create a custom post type "myspecialposts" and create single-myspecialposts.php (codex)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.