Articles of line breaks

How to prevent pages from automatically adding line breaks?

I’m trying to style a form on a website, but I’m hitting a snag. WordPress is automatically generating <br> tags when I directly edit the HTML for pages. What I’ve got is this: <fieldset> <legend>* Your name:</legend> <ul class=”singleLine”> <li> <span> <input id=”FName” type=”text” name=”FName” size=”20″ maxlength=”20″ /> <label for=”FName”>First</label> </span> <span> <input id=”LName” type=”text” […]

My simple custom shortcode is not longer working (possibly due to upgrade to WordPress 4.4 ?)

I have a simple function in functions.php that creates a custom shortcode: function my_line_break() { return “<br>”; } add_shortcode( ‘new line’, ‘my_line_break’ ); Now, I don’t know if this happened after upgrading to 4.4 but it’s not longer working and pages just render [new line] in plain text. Anyone can help with this? I looked […]

Preserving tabs and line breaks in <pre><code> when switching from HTML to Visual Editor

Tabs placed in a <pre><code></code></pre> block are stripped and line breaks are removed leaving a single continuous line of text. This occurs when switching from html to visual editors. Is there a setting in TinyMCE to avoid this? BEFORE: AFTER: Here it even garbles the code and spits parts of it out the <pre>… EDIT: […]

Preserving line breaks when saving and displaying custom fields data

I’m collecting data via a form plugin and saving that data in form of a post with several custom fields. I then display the content of the post and the custom fields on my post template using… if( get_post_meta( $post->ID, ‘_aboutus’, true ) ) : echo ‘<div class=”companyaboutus”>’ . get_post_meta($post->ID, ‘_aboutus’, true) . ‘</div>’; endif; […]

Remove empty lines (&nbsp;) when author updates their post

Whenever adding an empty line between paragraphs using TinyMCE, the &nbsp; character entity is added. How can I strip the content of all instances of this character whenever an author updates their post (save_post)?

line break are not working when editing a post

So I have a problem when making a post. If I press enter and make a new line in the editor and press safe the line break diapers. But when I show the post it have inserted a line break. So somehow the editor is not able to show the line break? If I save […]

How to include line-breaks in the_excerpt?

how can I include a line-break inside the_excerpt. I’ve modified the length and the more-button via my functions.php. I’m using teaser for every blog-entry and sometimes it looks a bit ugly, that there no line-breaks included.

How to keep &nbsp; non-breaking spaces in the visual editor?

I often add &nbsp; between connecting words so they break down together to a new line in important text. Switching to visual tab then back to text tab removes these. What can I do to keep them and avoid TinyMCE removing them? I found this but not sure how to apply it to WordPress: https://www.abeautifulsite.net/tinymce-removes-non-breaking-spaces […]

How to enable the <br /> tag in WordPress posts and pages

i can’t understand why so simple feature are disabled by WordPress Team. I want have line breaking with “br” tag. On one wordpress forum was idea to modificate editor.js (in wp-admin/js) and formating.php (in wp-includes) files. http://wordpress.org/support/topic/ltbrgt-stripping-problem-ultimate-solving I was tryed to do this, but 0 good results.

disable WP automatically inserted line breaks after an image

I’ve set medium sized images to a custom size which should allow for both of the images to align horizontally within the post. (The full post width is 880px, medium images are set to 413px.) My challenge is that the images are not evenly aligned – the image on the right is always a little […]