|
Post by mimjannat109 on Jan 9, 2024 4:11:07 GMT
Add a filter to replace <br/> tag Add a filter in the functions.php file which adds a clear attribute to the tag. When the attribute is added, the <br/> tag is not removed by WordPress. function clear_br content { return str_replace ,"<br clear='none'/>", content ; } add_filter 'the_content','clear_br' ; Post before adding filter WordPress line breaks filter Published post after adding filter WordPress line breaks filter . Create a WordPress Line Break br Shortcode You can add a shortcode to fix the line breaks not working issue in WordPress. Insert the following shortcode code into the functions.php file: function add_linebreak_shortcode { return add_shortcode 'br', 'add_linebreak_shortcode' ; Now insert the shortcode shown below wherever you want to insert a Email Marketing List space. Adding Shortcode in Text Editor WordPress line breaks shortcode Edit Post in Visual Editor WordPress line breaks shortcode Published Post after Adding Shortcode WordPress line breaks shortcode . HTML Br tag not working. Use CSS Some developers believe <br/> tags should not be used for styling pages. HTML is a semantic language, not to be used for defining positioning, styling or layout information. Use CSS to generate the style or size of paragraph margins using stylesheets. If you have basic knowledge of CSS, then all you need to add paragraph spaces is add a bottom margin to the <p> tag for the paragraph. Open the WP admin panel. Select the file style file on the right side.
|
|