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 am new to Wordpress and need some helps here. I am trying to add posts that have written codes for the demonstrated purpose of programming languages.

I installed SyntaxHighlighter Evolved plugin. The post looks great when I preview it or view the post under category. However, it seems that Wordpress generated <p> tag in my Home page and messed up the codes of the post. I am not sure how to fix this.

Any thoughts? Thanks a lot.

share|improve this question
    
Please add an example for the wrong output. –  toscho May 8 '12 at 18:53
    
Please see popslinger.org/wordpress If you click the post you will see the entire written codes, but it doesn't show in Home page. –  Jerry May 8 '12 at 19:00

1 Answer 1

up vote 1 down vote accepted

On archive pages like a blog home page the the_excerpt() is used normally. As the name says it shows just a snippet from your post.

Most content filters are not applied to the excerpt, they work on the_content() only.

Fix: change your template, replace the_excerpt() with the_content() in archive pages.

share|improve this answer
    
If I chagne my template to the_content(). The homepage won't use excerpt anymore. Is there a way to keep excerpt and still show part of my written codes as excerpt? +1 –  Jerry May 8 '12 at 19:21
    
No. The excerpt just takes a number of first words. It strips all markup. Otherwise there would be open tags, shortcodes without context … you could write a custom excerpt function that runs over the post_content and keeps the markup intact. But there are always some pitfalls. I wouldn't recommend it. –  toscho May 8 '12 at 19:26
    
IC, thanks for the help toscho. –  Jerry May 8 '12 at 19:34

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.