Hi,
I would love to make my webboard as a community for programmers; therefore, I would love to make the SyntaxHighlighter Plugin (or other similar plugins) be usable in wp-foro.
I have followed the previous 2 suggestions without sucess:
Here, I successfully copied the layouts folder to the destination /wpforo/layouts/1/post.php , but there is no line containing the following code as suggested. (is it due to wpforo update?)
<?php echo wpforo_content_filter( wpforo_kses($post['body'], 'post') ) ?>
2. this suggestion :
https://wpforo.com/community/general-discussions/quick-comparison-to-smf-and-mybb/#post-16371
However, in Dashboard > Forums > Settings > Features admin page , there is no option to enable the highlighter plugins.
Could you please kindly suggest ?
Best Regards,
Hi @labradorman,
Please follow these steps:
- Install and activate the SyntaxHighlighter Evolved plugin
- Navigate to Dashboard > Forums > Settings > Features admin page, make sure the "Enable WordPress Shortcodes in Post Content" is disabled.
- Add the following CSS code in your current active theme functions.php file:
function SyntaxHighlighter_fix_breaklines($content){ return preg_replace('#<br[^<>]*?>#isu', "\r\n", $content); } function SyntaxHighlighter_for_wpforo(){ global $SyntaxHighlighter; add_filter('wpforo_content_after', 'SyntaxHighlighter_fix_breaklines', 19); add_filter('wpforo_content_after', array($SyntaxHighlighter, 'parse_shortcodes'), 20); } add_action('wp', 'SyntaxHighlighter_for_wpforo');
However, please note you need to use the source ( {:} ) button when you're adding a code.
Dear Sofy,
Thank you so much for your kind and great help! It now works almost perfectly. Except with the same issue as mentioned in
That is, the sign '&' and '>=' are now rendered incorrectly as '&' and '>'. Is there any way to deal with this wrong renders ? (I try to search for a simple solution, but couldn't find it)
I understand that the solution may require some of your efforts. Since this function is very important to my website, and wpforo is the best webboard on wordpress, if there is a service cost for this solution, I would be happy to pay for it.
Hi labradorman,
Thank you for your interest in the wpForo.
The code I've provided just allows the SyntaxHighlighter Evolved plugin to work in wpForo post content. We've checked the code and it works fine on our test websites.
For further support, we'll need admin accesses. Please send login details to info[at]gvectors.com email address.