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?
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:
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 …
My wp theme is twentyfifteen ,font in style.css is inherit,the font in firefox is noto mono. I found that one white space is as width as one character in wordpress development--this forum,two white spaces is as width as one character in my wordpress. How to set one white space as width as one character in wordpress?
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" …
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 …
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.
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 &quot; &amp; 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 …
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 <pre> tags …
This $('#content').load("submenu.php"); works just fine with default permalinks When I switch to %postname% it does not work any more But, I can still go though to mysite.com/submenu.php and it loads just fine Did I miss something here?
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 <pre></pre> 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 …