Tag Info

New answers tagged

0

Assuming the issue is the <br> tag (which I believe is correct) and based on one of your comments indicating that you do not wish to go back and edit the posts, you could use the the_content filter to look for instances of two medium-sized images separated only by a new line (which is being replaced by a <br> tag as part of WordPress' wpautop() ...


0

You could try using jQuery to remove them for you: jQuery(document).ready(function($){ $('img').next('br').remove(); }); This should remove any br tags after images as next will select the immediate next element. If that gives you issues you can try .nextAll('br:first') instead See here for more examples and things you can try.


1

The quick fix is to wrap your image tags in div tags. That will prevent WP from wrapping the images in P tags. Then, you could give the divs a class for further control of appearance/arrangement.


1

You are correct that it is the <br> tags, but there is an alternative: Place each image in their own paragraph, not adjacent lines This is how line breaking works in WordPress content: Paragraphs This is paragraph 1 This is paragraph 2 Short line breaks This is paragraph 1 This is also paragraph 1 but on a new line without a space So don't ...


5

If this is how it looks: <img class="alignleft size-medium wp-image-8530" alt="..." src="#" width="413" height="275" /> <img class="alignleft size-medium wp-image-8529" alt="..." src="#" width="413" height="275" /> Then you have to put them together like this: <img class="alignleft size-medium wp-image-8530" alt="..." src="#" width="413" ...


-5

Try Using shift + enter instead of enter in the editor.


1

We can not hook wpautop() function. Because then it will trim all the paragraph and break tags from the content. After inserting the image in the editor just click on "Text" tab on the top right corner of the editor and remove the paragraph and break tags that comes in between images. For more options(like alignment and other attributes) click on the ...


0

The wpautop() function adds <p> and <br> tags to your content in order to preserve line breaks. If you would rather add these tags yourself, then you can remove the filters which apply this function to the post content: remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); remove_filter( 'the_content', 'wpautop' ...


0

It is possible to add line breaks using &nbsp; in the "Text" view like so: https://cloudup.com/cb5PCT2sWRP One thing to be aware of is that once you add the HTML for non-breaking spaces, you must remain in the "Text" view for future edits; switching back and forth to the visual editor will remove the above code.


0

Remove your line break tag between your images. Example: <img src="" alt="" /> <br/> <img src="" alt="" />



Top 50 recent answers are included