Code not Prettifying on Main Page (2 posts)

  1. mattshelton
    Posted 3 years ago #

    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);
    			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();


  2. Stephen Harris
    Plugin Author

    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-Markdown
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.