Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Posting Code into Topics
Avatar
rebeccagill
Detroit, Michigan
Member
sp_UserOfflineSmall Offline
Mar 14, 2012 - 7:10 pm

We are using the forum for theme support and my technical support team is having trouble posting actual code for forum users to read and copy.  I'm 100% sure there is an easy fix for this and it is probably already listed in the forum somewhere.  For the life of me I can't find it.

 

Can you provide a brief set of instructions for posting code into the forum and having it display as code?

 

Thanks so much!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 14, 2012 - 7:14 pm

First, install and activate the SP 'Syntax Highlighter' plugin.

To use it you really need to be using the tinymce editor although it can be used manually in other editors.

Insert the code. You need to really copy the code from a code editor and paste it into the post. Highlight the code section (only) with the mouse cursor and then open the editor toolbar code button (far right) and select the code language being used.

That's it.

andy-signature.png
YELLOW
SWORDFISH
Avatar
rebeccagill
Detroit, Michigan
Member
sp_UserOfflineSmall Offline
Mar 14, 2012 - 7:16 pm

Thanks so much for the thorough and prompt reply.  I will pass onto my tech guys to implement.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 14, 2012 - 7:32 pm

Hope it works for you OK. We use it on this site quite extensively. You have the option to use it in blog posts as well once it is active.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Rolf Hassel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 17, 2013 - 6:11 am

Sorry for the test here:

 

<?php
 if ( file_exists(STYLESHEETPATH . '/featured.php') )
 include_once(STYLESHEETPATH . '/featured.php');
 else
 include_once(TEMPLATEPATH . '/featured.php');
 ?>

 

test

Avatar
Rolf Hassel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 17, 2013 - 6:26 am

hmm, that's what i get:

synt.pngImage Enlarger

colors can be set?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 17, 2013 - 8:13 am

I would need to be able yo see the actual forum page this is on to be able to see what CSS is being applied (using Firebug or any built in browser development tools) but my guess is that this is being overridden in some way by your WP theme or another plugin. No way to know without inspecting it...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Rolf Hassel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 17, 2013 - 1:19 pm

Thanks for helping here. Here is the site: http://myclassipress.com/

WordPress 3.5.1

Theme: "Appply" from Woothemes ( http://www.woothemes.com/produ.....ts/appply/ )

Changes done in the forum: Only some color changes in shades-of-gray(css)

It seems that there is a conflict between this syntax highlighter in the forum and the Crayon highlighter from http://aramk.com/projects/cray.....ghlighter/ because i just made a test and switched off the Crayon plugin. The code then gets highlighted in the forum as it does here.

It's not a solution for me to use the highlighter from the forum in my blog, as Crayon gives much more possibilities in use. When you visit the site you will understand why the syntax highlighter is one off the most important things that gets used. (tutorials)

I hope you can give me a solution. 

Thank you

 

 

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 17, 2013 - 2:00 pm

First question is does this 'Crayon' plugin allow you to stop it being loaded on certain pages?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Rolf Hassel
Member
Free Members
sp_UserOfflineSmall Offline
Apr 17, 2013 - 4:04 pm

No, there is no such option. 

 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17367
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626