First of all you should use the standard pre
and code
elements instead of blockquotes. But if have too many to change them, there might be a workaround.
If you only use blockquotes for code, then you can use a bit of jQuery to convert those to pre
tags, but make sure to do that before Prettify is loaded.
I don’t know how the plugins work, but I can help you do it directly with Prettify.
Download it from here and enqueue it on your website.
Then use this jQuery to convert blockquote
to pre
and trigger Prettify.
$("blockquote").replaceWith(function() { return "<pre>" + $(this).html() + "</pre>"} );
prettyPrint();
Related Posts:
- Proper implementation/use of code/syntax highlighting
- Return $post_id when DOING_AUTOSAVE?
- What theme is good for posting code? [closed]
- Including Angle Brackets In Pre Sections
- Anchor Text code string is automatically modified by WordPress
- WordPress is converting & to & inbetween [code] brackets
- Notice: Undefined property: wpdb::$current_post What can be wrong?
- Where to save common libraries?
- source code: WP_INSTALLING vs. WP_SETUP_CONFIG in setup-config.php
- Sublime Video: Playlist which gets all attached videos
- Code Friendly Block Quotes
- Remove line breaks from ?
- How to fix a “globals” issue to avoid a rejected theme?
- Need resource on available functions and objects
- WordPress wp_insert_post() returns 0 but not not wp_error
- I want to remove the home page header image from all other pages
- How to remove all comments from JS, HTML, CSS files?
- What data validation we must use in different contexts?
- Need To Post Unformated Code
- Sidebar login: How do I get the username to show after “Welcome”?
- How to manage multiple wordpress project with shared code base
- Block IP Addresses using Code [closed]
- Find Total Authors
- Why does HTML entities are still encoded in Code Block?
- How to create a checkbox to show/hide a field in WooCommerce checkout [closed]
- how to display google maps with javascript
- How to pass https://achecker.ca/ validator? [closed]
- How to write custom code on WordPress?
- Remove Metaboxes
- Google analytics won’t work in wordpress
- Where do I add an action hook & callback in my theme?
- How do I reset my footer.php to its original state? (theme: Origami)
- Commenting out in HTML editor breaks template
- wordpress prepare error
- Adding code to send referrer on login page
- Table styles disappear when updating content
- Manage recurring event time
- wp_editor save all content
- Need an elegant solution to declare the value of two variables based on the count of the post
- How to insert integration code for CRM?
- Embedding code snippets in posts with indentation
- A good way to include snippets of code in both posts, pages and Event Manager Template files?
- Anchor Text code string is automatically modified by WordPress
- Return $post_id when DOING_AUTOSAVE?
- Changes in code only show after changing theme
- feed url problem
- Where do I go to add a tag before the closing body tag?
- HTML5 rich-text inside textarea
- How to have syntax highlighting in wordpress.com blogs?
- VERY new to coding – keep breaking site trying to add to functions.php
- How can I include PHP-Code to my post?
- Problem with tag
- How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?
- How can I highlight syntax like it appears on stackoverflow?
- Replacing the default content created while the site creation
- How do i get (unique) page name?
- Gist shortcode is not working
- How to display posts of specific category using a custom Query in WordPress?
- How to make this WP_Query run faster on a WordPress website?
- What kind of data is that?
- how to remove the top navigation bar or header top on wordpress website?
- Where can i find wordpress auto update code flows?
- How does WordPress determine which multisite the user is on from the URL?
- Cause of Blank Lines Being Added to WP FIles?
- Changing wordpress publication date to ACF date and time picker date not working
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- code highiglight not working comment
- Pasting code into WordPress post – LFs being eaten
- Log in / Log Out Custom Button
- Tips for managing code when developing a parent theme framework
- PHP nested If statement syntax
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- How to Configure Events List in WordPress to Disappear Event Once Date is Past
- Code snippet to show current php version inside “At a Glance” box in admin
- Need to create a custom page on a website
- wp_get_http has been deprecated. Use WP_Http instead
- Add Permalink to Post Thumbnail, syntax code issues
- I want a widget to appear on only one page
- Code block treats characters not being escaped
- Display a specific category in a focused area of my site
- Reorder a page of posts of a certain taxonomy/value by a custom field
- WP search box on page not finding .PDF files
- Changing the Default New User Notification Email
- JQuery script working locally on desktop, not working on WordPress + Divi
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- How do I prevent WordPress from eating my code?
- WordPress 5.1 and Syntax highlighter, problem with HTML encoded special characters
- How to include a hyperlink in the body text of a custom password protected form?
- how to run a php code in widget?
- Pull ‘Popular Posts’ within specific timeframe
- how to add number value in front for variable [closed]
- Code to Show for One post only in head
- get post excerpt by query
- Commenting in CSS (//) equals “none”? [closed]
- I want to add the alt attribute to all the photos!
- Add variable : 1 Week ago
- Changes to code not displaying
- How to give specific class name to category in wordpress with code snippets
- Only Admin receives email
- Convert Image to Webp on upload without plugin