Few days ago I published an article about highlighting code in Ghost and I decided to do the same with WordPress for embedding code snippets easy . You may tell that there are hundreds of plugins for that, but I don't like installing tens of plugins.
Here is what you'll see after finishing this tutorial:
add_action( 'pre_get_posts', 'minimum_toolbox_items' );
function minimum_toolbox_items( $query ) {
if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'toolbox' ) ) {
$query->set( 'posts_per_page', '12' );
}
}
Ok, lets cut to the chase.
Download source files
Use this form to download source files, you will also help us by sharing this post. Thanks!
[sociallocker]
87syntax
[/sociallocker]
Install Prism
Just use your FTP program to upload extracted files on server and add one line of code to your functions.php file.
1. Upload 87syntax folder to wp-content/theme-name/.
2. Enqueue scripts to your functions.php.
It's very easy, just add this line to your functions.php file
require( '87syntax/87studios-syntax.php' );
How To Use
That’s pretty much easy, use php html css javascript shortcodes around the code:
[ php ] code goes here [ /php ]
I hope this tutorial will help you. Enjoy!
Leave a Reply