I was just updating the terms and conditions of this very website when I stumbled across an ‘annoyance’ or ‘foible’ of WordPress. When using a Global Content Block to help reduce repeat-typing content, I found that using the ‘General’ type of block was causing wordpress to add “<p>” tags before and after the content.Seems innocuous enough, but when I was using the blocks in my content (within a standard line or paragraph of text like this), I would suddenly get a big gap, then the content of my block, another big gap and then the sentence would continue – less than ideal.
So, looking for an answer, I thought about it for a few seconds and decided that if I switched the block type to HTML, then this a) should not affect the content as (in this example) I just wanted to display the company name and b) would prevent wordpress from auto appending those pesky “<p>” tags.
<p>BTW: for those of you who are wondering what those tags are, they are the HTML equivalent of a ‘paragraph’ and you use it to designate chunks of text which needs spacing around it – much like when missing a line after a paragraph in Word or some other similar rich text editor. I have added them to this paragraph to show you what they look like.
This also got me thinking – turns out there are another couple of useful scenarios where using the HTML block type could come in handy:
- When setting the email links for your website, you can ensure every time it is displayed it is a clickable link which enables the reader to email you:
- When setting the phone links for your website, you can ensure every time it is displayed it is a clickable link which enables the reader to call you:
<a href="tel:01604212535">01604 212535</a>
I hope this little workaround helps somebody out there!