Including Angle Brackets In Pre Sections

I am attempting to post some java code between pre tags but the angel brackets get removed. For example: private HashMap<String, HashMap<String, Integer>> featureCounts; becomes private HashMap> featureCounts; Is there a way I can render the actual code? Also I am not a php developer or a wordpress expert by any means, so modifying the underlying php would be less preferred as a solution. Is there a way I can do this just using the editor?
Category: Web

Write html code in comments

For example i am writing this html code into comment textarea <pre><code class="language-php"><?php echo esc_html( get_post_meta( get_the_ID(), ‘_spp_count’, true ) ); ?></code></pre> But it looks like this:
Category: Web

Keep pasted pre formatted code as it is -with tabs- in visual editor

I need a manual code to my functions php to extend the visual editor from removing tabs when pasting code blocks. I tried this code, found at this site, but it does not work as I want. If I got: add_filter('tiny_mce_before_init', 'tiny_mce_before_init'); function tiny_mce_before_init($init) { $init['setup'] = "function(ed) { ed.onBeforeSetContent.add(function(ed, o) { if ( o.content.indexOf('<pre') != -1) { o.content = o.content.replace(/<pre[^>]*>[\\s\\S]+?<\\/pre>/g, function(a) { return a.replace(/(\\r\\n|\\n)/g, '<br />'); }); } }); }"; return $init; } and paste into Visual, I got …
Category: Web

How to order custom user list columns by datetime?

I am trying to add the ordering options to some custom user list columns I added in the Wordpress admin. This is my code : function mmm_user_sortable_columns_query( $userquery ){ if( 'test_date' == $userquery -> query_vars['orderby'] ) { global $wpdb; $userquery -> query_from .= " LEFT OUTER JOIN $wpdb->usermeta AS alias ON ($wpdb->users.ID = alias.user_id) "; $userquery -> query_where .= " AND alias.meta_key = 'test_date' "; $userquery -> query_orderby = " ORDER BY alias.meta_value " . ($userquery -> query_vars["order"] == "ASC" …
Category: Web

Woocommerce Pre Orders view order link wrong

The link that the pre order module produces in My Account doesn't work. It has to display like this: /my-account/view-order/15977 but how it displays now is: /my-account/?order=15977. How can i change that link to my structure. This is the piece of code which displays it: <td class="order-number" width="1%"> <a href="<?php echo esc_url( add_query_arg( 'order', $order->id, get_permalink( woocommerce_get_page_id( 'view_order' ) ) ) ); ?>"><?php echo $order->get_order_number(); ?></a> </td> i also want it to be update proof ofcourse so how can i …
Category: Web

Need To Post Unformated Code

Im wanting to use wordpress to share some code snips. However when viewing the posts some of the code tries to format even though its in pre or code tags. Is there anyone way to modify <?php the_content(); ?> So that it will replace <, and > with the correct <, and > methods? I think this is my issue.
Category: Web

replace html entities in posts between pre tags

I run a wordpress blog with a syntax highlighter plugin (Crayon). The plugin highlights code between pre tags, example: <pre class="lang:languageid" title="example"> some code </pre> Wordpress sometimes replaces characters suchs as " & < > with html entities which are shown in the code " & etc. I tried several plugins that should prevent this but they don't (always) work. Is there an easy method to bulk edit old posts and search for entities between pre tags en replace them …
Category: Web

Formatting with <pre>

I'm building a site that doesn't want any styling applied to the entry-content, because it should keep the formatting of the text. Bizarly, it works on old entries, but new entries via the front-end system fail: http://madebylars.nl/music/?page_id=373 Example: This one works: http://madebylars.nl/music/?tab=the-tallest-man-on-earth-love-is-all This one doesn't: http://madebylars.nl/music/?tab=the-tallest-man-on-earth-like-the-wheel They both look fine in the WordPress back-end, but only one of them looks nice on the front-end. Any thoughts on how to fix this? I'm already wrapping the whole text in &lt;pre&gt; tags …
Category: Web

Wordpress automatically adds <pre> tags when pasting code, how to stop it?

I am presently learning PHP and Linux simultaneously. And I want to blog my notes not only for my future reference, but also because it could help others. I just noticed an issue with Wordpress - - it automatically adds &lt;pre&gt;&lt;/pre&gt; tags in the background (HTML-side I mean, in the visual editor I see the code's background highlighted) as soon as I paste some code, be it HTML, PHP etc. I have searched a lot, and could find nothing about …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.