How To Publish Code In WordPress Blog Posts
I love WordPress, but one of the features I’ve had problems with in the past is how to publish code in posts. I’ve managed to find my way of adding code to posts, but it’s not particularly user-friendly and not one for sharing.
Luckily, the lovely Lorelle has put together a great guide to Writing and Publishing Code in WordPress Blog Posts. As with all of Lorelle’s work, it’s very well written and laid out. Essential reading if you are WordPress User.
More: Guide To Writing and Publishing Code in WordPress Posts
Bookmark & Share
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 've had problems with in the past is how to publish code in posts. i've managed ' at line 1]
SELECT ID, post_title, post_date, post_content, (MATCH (post_content) AGAINST ('i love wordpress, but one of the features i've had problems with in the past is how to publish code in posts. i've managed to find <em>my</em> way of adding code to posts, but it's not particularly user-friendly and not one for sharing.
luckily, the lovely lorelle has put together a great guide to writing and publishing code in wordpress blog posts. as with all of lorelle's work, it's very well written and laid out. essential reading if you are wordpress user.
more: <strong><a href="http://www.blogherald.com/2007/07/16/writing-and-publishing-code-in-your-wordpress-blog-posts/" title="guide to publishing code in wordpress posts" target="_blank">guide to writing and publishing code in wordpress posts</a></strong>')) as bodyscore, (MATCH (post_title) AGAINST ('how to publish code in wordpress blog posts')) as titlescore, COUNT( DISTINCT tagtax.term_taxonomy_id ) as tagscore, COUNT( DISTINCT cattax.term_taxonomy_id ) as catscore, (0+ (MATCH (post_content) AGAINST ('i love wordpress, but one of the features i've had problems with in the past is how to publish code in posts. i've managed to find <em>my</em> way of adding code to posts, but it's not particularly user-friendly and not one for sharing.
luckily, the lovely lorelle has put together a great guide to writing and publishing code in wordpress blog posts. as with all of lorelle's work, it's very well written and laid out. essential reading if you are wordpress user.
more: <strong><a href="http://www.blogherald.com/2007/07/16/writing-and-publishing-code-in-your-wordpress-blog-posts/" title="guide to publishing code in wordpress posts" target="_blank">guide to writing and publishing code in wordpress posts</a></strong>')) * 3+ (MATCH (post_title) AGAINST ('how to publish code in wordpress blog posts')) * 3+ COUNT( DISTINCT tagtax.term_taxonomy_id ) * 1+ COUNT( DISTINCT cattax.term_taxonomy_id ) * 1) as score
from wp_posts
left JOIN wp_term_relationships AS thistag ON (thistag.object_id = 467 )
left JOIN wp_term_relationships AS tagrel on (tagrel.term_taxonomy_id = thistag.term_taxonomy_id
AND tagrel.object_id = wp_posts.ID)
left JOIN wp_term_taxonomy AS tagtax ON ( tagrel.term_taxonomy_id = tagtax.term_taxonomy_id
AND tagtax.taxonomy = 'post_tag')
left JOIN wp_term_relationships AS thiscat ON (thiscat.object_id = 467 )
left JOIN wp_term_relationships AS catrel on (catrel.term_taxonomy_id = thiscat.term_taxonomy_id
AND catrel.object_id = wp_posts.ID)
left JOIN wp_term_taxonomy AS cattax ON ( catrel.term_taxonomy_id = cattax.term_taxonomy_id
AND cattax.taxonomy = 'category')
where (post_status IN ( 'publish', 'static' ) and ID != '467') and post_password ='' and post_type IN ('post', 'page')
group by id
having score >= 8 order by score DESC limit 6


Comment by Lorelle on 18 July 2007:
Thank for the recommendation and I’m glad that article helped. It’s so important to present code to your readers in a way that they can use it and not cause more trauma.