Title: [Plugin: WP-Markdown] Code not Prettifying on Main Page
Last modified: August 20, 2016

---

# [Plugin: WP-Markdown] Code not Prettifying on Main Page

 *  [mattshelton](https://wordpress.org/support/users/mattshelton/)
 * (@mattshelton)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-code-not-prettifying-on-main-page/)
 * There is a function in wp-markdown.php that determines if the prettify.js should
   be loaded:
 *     ```
       /*
       	* Function to determine if prettify should be loaded
       	*/
       	function loadPrettify(){
       		$options = get_option($this->domain);
       		if(empty($options['prettify']))
       			return false;
   
       		$savedtypes = (array) $options['post_types'];
   
       		return is_singular($savedtypes);
   
       	}
       ```
   
 * This means that, on the main page of my blog, code will not be colorized. I recommend
   you change the final return to be:
 *  `return is_singular($savedtypes) || is_home() || is_front_page();`
 * [http://wordpress.org/extend/plugins/wp-markdown/](http://wordpress.org/extend/plugins/wp-markdown/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Stephen Harris](https://wordpress.org/support/users/stephenh1988/)
 * (@stephenh1988)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-code-not-prettifying-on-main-page/#post-2994841)
 * Thanks Matt!
 * Unfortunately I haven’t been getting email notifications from this forum, so 
   apologies for the delay. But someone reported this on the GitHub repro, and I’ll
   be producing a fix shortly. It’ll be slightly different from what you propose
   since I don’t want to unnecessarily load javascript when its not needed.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WP-Markdown] Code not Prettifying on Main Page’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-markdown_d5ecec.svg)
 * [WP-Markdown](https://wordpress.org/plugins/wp-markdown/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-markdown/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-markdown/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-markdown/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-markdown/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-markdown/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Stephen Harris](https://wordpress.org/support/users/stephenh1988/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-markdown-code-not-prettifying-on-main-page/#post-2994841)
 * Status: not resolved