adding Syntax highlighting to webpages (HTML/php)

mariedove

New Member
I'm using http://softwaremaniacs.org/soft/highlight/en/ to Syntax highlight HTML. I've got a php loop pulling code from a wordpress. I'm using the \[code\]pre / code\[/code\] tags in my code and the following loop to pull the code from wordpress. \[code\]<?php while (have_posts()) : the_post(); ?><p><i><?php the_date(); echo "<br />"; ?> </p></i><h2><?php the_title(); ?></h2> <p><?php the_content(); ?></p><?php endwhile;?>\[/code\]At the top of my php page I've got the import...\[code\]<script type="text/javascript" src="http://stackoverflow.com/questions/3553053/highlight.pack.js"></script><script type="text/javascript">hljs.initHighlightingOnLoad();</script>\[/code\]The test.html on the page works fine but my page doesnt seem to on my web server. Is it something to do with the way I'm dynamically pulling content? How would I make this work?
 
Back
Top