When someone links to your site with the wrong URL, or, worse, you link to your own site with the wrong URL, it would be nice to know. You could check your server’s logs for 404 errors to see what bad URLs people are using. But I find it easier to create a simple 404 log file that I can access without much hassle. Then I check it every once in a while to see if I need to add a redirect to the correct page so I don’t miss some traffic.Continue reading “Hack: Create a Simple 404 Log”
Categories and tags are useful for a number of purposes. Sometimes you want to have a category or tag that is for backend purposes, and not necessarily for display. Sometimes you want writers on your site to only see certain terms. You can filter these easily with the list_terms_exclusions hook.Continue reading “Hack: Exclude Categories or Tags From Lists”
When you publish a new post you will get hit with a short checklist of things before the post goes live. This is usually very useful and doesn’t take up much time. But if you publish often and don’t mind fixing problems after you publish, then you can turn off this feature.Continue reading “Tip: Using And Turning Off Pre-Publish Checks”
You don’t need some giant third-party plugin to implement SEO techniqueson your WordPress site. You can write your owncustomizable functions to include with your child theme or custom plugin.
But taking advantage of some basic WordPress actionsand filters, you can modify things like your titleand H1 tags, meta datatags and other header code. You can set some or all of your links to nofollowand add related linksto your posts automatically. You can also include sitemaps.
If you are a developer, then creating your own simple SEO plugin can be an improvement over including a massive third-party plugin that will overwhelm and confuse your clients. If you maintain your own site, a custom plugin can be more streamlined and give you greater control over how you implement SEO.
This course includes all of the code discussed in the lessons. You can take the code and use it on your site, customize it, and distribute it to clients if you wish.
I previous showed you how to place some text over an image when you added it to your Media library. But you may want more than plain text. Here is a way to use a transparent PNG file instead. This example show some text and a logo, with a white drop shadow to make the dark watermark stand out.Continue reading “Hack: Automatically Watermark Your Images With a Transparent Overlay”
Putting some text on every image you use on your blog can be a pain if you do it manually. It would be so great if WordPress just did this automatically. Here is one, pretty simple, way to do it. You can see the result in the image below.Continue reading “Hack: Automatically Watermark Every Image You Upload to WordPress”
By default a list of posts will appear with the most recent one on top and the rest in descending chronological order. But if you have a need to show the list in alphabetical order, then you can change that in the pre_get_posts hook. One example may be a glossary. Another may be like the one-page site I created the other week.Continue reading “Hack: Show Post List In Alphabetical Order”
Typically when someone wants to add a bunch of stuff to the <head> tag of a theme, they edit the header.php file in the theme or child theme. But even doing it properly in the child theme means that file overrides the header.php of the parent theme and won’t get updates from that point on.Continue reading “Hack: Adding Lines To Your Page Head Without Altering Your Theme”
I came across this issue while trying to build a sitemap script inside of a WordPress plugin. In the past, I’ve just created a stand-alone PHP page that accesses WordPress and displays the sitemap. But I wanted to keep this code inside the plugin code. The problem is, you typically use plugin code to create contain insider a WordPress frame. But I just wanted plain text here, not the header and footer and all of that.Continue reading “Hack: Create a Simple Non-WordPress Page”
While the default paragraph block doesn’t offer much in the way of styling your text, you can always fall back on HTML and add CSS styles directly to text using span tags and the style attribute. So you can make links a different color, bold text, and so on. You can then switch off HTML editing and continue writing.Continue reading “Tip: Styling Links and Text In WordPress Blocks With HTML”