How can I include PHP-Code to my post?

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.

Read More

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?

Related posts

Leave a Reply

2 comments

  1. 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)