WordPress.org

Ready to get started?Download WordPress

Forums

WP-Markdown
Code not Prettifying on Main Page (2 posts)

  1. mattshelton
    Member
    Posted 1 year 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);
    		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/

  2. Stephen Harris
    Member
    Plugin Author

    Posted 1 year 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

About this Topic

Tags

No tags yet.