Integrate PrismJs in Newspaper8 Theme

Posted in: Newspaper
Post count: 12

I would like to integrate PrismJs syntax hightlighter in Newspaper 8.7 theme. I have included the following code in functions.php file inside theme folder.


// Function to add prism.css and prism.js to the site
function add_prism() {
//To register the prism.css
wp_register_style( 
'prismCSS', //Handle name to register and enqueue prism.css
get_stylesheet_directory_uri() . '/prism.css' // location of the prism.css file
);
// Register prism.js file
wp_register_script( 
  'prismJS', //Handle name to register and enqueue prism.js
get_stylesheet_directory_uri() . '/prism.js' // location of the prism.js file
);
// Enqueue the registered style and script files
wp_enqueue_style('prismCSS');
wp_enqueue_script('prismJS');
}
add_action('wp_enqueue_scripts', 'add_prism');

But, it has no effect. I have uploaded prism.js and prism.css file in the same directory as functions.php file directory.
When I view the source code, it show both file but no luck. Please help

Post count: 22421

Hello,

Sorry but we have not tested PrismJS so I cannot say for sure if it will work with our current implementation. This represents customization and is not covered by the theme support.

Thank you for understanding.!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.