Haha. Yeah, that’s the best way I can think of as well. Or at least that’s partially how I did it with the CSS new page trick. Except that I didn’t use the PRE tag cause the fonts look like… yuck on my theme.
Let me guess, you’re using the & to get the & sign so you can show this page. ahahahahaha…
Anyhow, I still hope that there’s better solution out there. I find that this way is not really very efficient.
Elliot Swan says:
You can always use CSS to style the tags if you don’t like how they look.
I’m betting there’s a way you could apply PHP htmlspecialchars() to all <code> tags.
I know about that function. But, I’m not too sure on how to apply it into wordpress posts. I’ll give that a try. Thanks.
Elliot Swan says:
You wouldn’t want it applied to everything in your wordpress posts, because then you couldn’t use links or anything. You’d just want to apply it to everything contained within code tags. I’m sure it’s possible, I just don’t know how it’s possible lol.
Oh, now I get what you mean. Hmm.. I’ll let you know if I could figure out anything.
joehong » Writing codes on your wordpress says:
[...] I did get a hint from a blogger called enrii to do some trick with pre tag. [...]
Joe Hong says:
just wanted to share that this plug-in may be a solution to the problem. You can go check it out.
When come to contents, I would prefer to do what I’m currently doing, rather than to rely on plugins. Thanks for your suggestion.
Penulisan Code PHP dan HTML di Wordpress | Hariannya Rizky | Blog Rizky says:
[...] Lalu mencari-cari artikel yang saya dapat dari sini bahwa penggunaan kode bisa kita tulis dan dikenal di postingan WP dengan mengakalinya dengan Character Entities, dan masalahnya ada pada bagain pembuka kode < dan penutup >. Karena secara dengan otomatis WP akan merubah bagian < menjadi < dan bagian < menjadi >. [...]
Thank you for the tip.
Thanks! Very helpful for my first tutorial.
MANY MANY THANKS!