Forums

can't get syntax highlighting to work with any plugin in 2.3.1 (5 posts)

  1. bkjones
    Member
    Posted 1 year ago #

    I have just moved a blog from wordpress.com (http://m0j0.wordpress.com) to one that I host myself (http://www.protocolostomy.com). One thing I need badly is syntax highlighting. I have downloaded and installed both the google-syntax-highlighter and the syntaxhighlighter plugins, but I can't get either one of them to do anything useful at all. My browser's error console says "dp is not defined". Since that appears to be the object whose methods are supposed to do all the work, that would probably be the problem, but I'm not sure why it's happening or how to fix that.

    I have made sure that the wp_footer() call is in the footer of my theme. I have made sure that the permissions on the js files are correct. I have compared the source of the generated page between the wordpress and protocolostomy pages. I have ensured that the .js files are being referenced in the page source. I have googled rather extensively and read the readme.txt of both plugins. I have tested on several browsers, and confirmed that the proper thing happens in all browsers if I go to the wordpress.com site, and that the proper thing does *not* happen on my new site.

    For reference, the page I'm using to test on each blog:
    This one works: http://m0j0.wordpress.com/2007/10/31/getting-at-your-google-spreadsheets-columns/
    This one doesn't: http://www.protocolostomy.com/2007/10/31/getting-at-your-google-spreadsheets-columns/

  2. Viper007Bond
    Member
    Posted 1 year ago #

    You need to install the plugin correctly and keep the file structure intact.

    This shouldn't be a 404.

  3. sherpasonic
    Member
    Posted 1 year ago #

    I am having problems, I don't have any 404s occuring, the syntax highlighting is simply not working.

    see here for an example.

    Update: I changed my code='' attribute value from 'rb' to 'ruby' and everything seemed to work fine.

  4. bkjones
    Member
    Posted 1 year ago #

    Viper007Bond,

    Thanks for the feedback - you're right, of course. However, I wonder why the distribution I downloaded came with all of the files named with all lower-case letters! :-/ Making symlinks to the files with the correct names fixed the issue.

  5. Anonymous
    Unregistered
    Posted 1 year ago #

    I got "Double Code Boxs" with these plugin. I've tried a lot of way to fix it,but unfortunately I got nothing. Any suggestion for this?

    I use Structure Theme from Justin Tadlock and WP 2.6.

    Please take a look my footer.php and what's wrong with there?

    </div>
    
    		<?php include(TEMPLATEPATH . '/sidebar.php'); ?>
    
    	</div>
            <div id="footer">
               <?php wp_footer(); ?>
    
    		<?php _e('Copyright','structure'); ?> © <?php print(date(__('Y','structure'))); ?> <a>"><span><?php bloginfo('name'); ?></span></a>
    
    		<a href="http://justintadlock.com/archives/2007/12/09/structure-wordpress-theme">"><?php _e('Structure theme','structure'); ?></a> <?php _e('by','structure'); ?> <a href="http://justintadlock.com" title="Justin Tadlock"><span> Justin Tadlock</span></a>
    
    	<p class="icons">
    		<a href="http://wordpress.org">"><img class ="wp-icon" src="<?php echo bloginfo(template_directory) .'/images/wp-icon.gif'; ?>" alt="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform','structure'); ?>" /></a>
    
    	</div>
    
    </div>
    
    <!-- SyntaxHighlighter Stuff -->
    
    <link type="text/css" rel="stylesheet" href="/wp-content/plugins/google-syntax-highlighter/Styles/SyntaxHighlighter.css"></link>
    <script language="javascript" src="r/wp-content/plugins/google-syntax-highlighter/Scripts/shCore.js"></script>
    <script language="javascript" src="/wp-content/plugins/google-syntax-highlighter/Scripts/shBrushCSharp.js"></script>
    <script language="javascript" src="/wp-content/plugins/google-syntax-highlighter/Scripts/shBrushXml.js"></script>
    <script language="javascript">
    window.onload = function () {
    dp.SyntaxHighlighter.ClipboardSwf = '/wp-content/plugins/google-syntax-highlighter/Scripts/clipboard.swf';
    dp.SyntaxHighlighter.HighlightAll('code');
    }
    </script>
    </body></html>

    Thanks in advance!!!

Topic Closed

This topic has been closed to new replies.

About this Topic