How’d you do that? WordPress, HTML, CSS and more
We’ve shared a few tips recently in the Facebook WordPress for Nonprofits group and Give Community that are worth re-sharing here.
Before we get to the tips, here’s a setting we recently found:
In your user profile in WordPress, there is a box you can check to disable the Code Mirror syntax highlighting, auto-completion / hinting and linting features in the Custom HTML Widget and the Additional CSS Editor in Customizer. The Code Mirror helpers are nice to have when you’re writing new code but they drive me crazy when editing existing code as they want me to fix unclosed tag before I finish what I’m working on. I’ve disabled Code Mirror for now.
Now for the tips
First up, how to best present PDF files. This was in response to a question in the WordPress for Nonprofits Facebook Group.
Generally we insert PDF files with the Add Media button. After inserting them, if you’re in the Visual editing tab, click on the link, click the pencil icon then click the gear icon. Check the box to open the link in a new tab. PDFs should usually open in a new tab because they lack your site’s header, navigation and footer so the user will have a harder time navigating away from the PDF once opened. By opening it in a new tab, they can just close the tab when done and be back in your site where they left off.
If you’re using a theme that includes Font Awesome Icons, you can add a little CSS to make a PDF icon appear after links to PDF files like in image below. Here’s the CSS:
a[href$=”.pdf”]:after {
font-family: FontAwesome;
content: “