Category Archives: WordPress

Tips and Tricks on WordPress usage and development. I am very passionate about WordPress, but it doesn’t work just by itself – it needs a rich environment to live and breathe in.

If you’re after theme and plugin alterations, we have a category for that.

How to remove the Jetpack Feedback Tab

In this episode I’ll explain how we can hide the Feedback Tab that the Jetpack plugin adds to the sidebar of the admin interface in WordPress.

This tab is part of the Contact Form feature, which sadly cannot be switched off with a single slider. We’ll have to delve into debug mode and do it “the hard way” – but fear not, there’s not code hacking involved, and I’ll be with you every step of the way.

How to hide WordPress Update Notifications with ZEN DASH

In this episode I’ll show you how to hide and remove those (almost daily occurring) WordPress Update Notifications. I’ve built this functionality into a plugin I’ve written over 5 years ago called ZEN DASH. The plugin’s main purpose is to hide all kinds of clutter from the WordPress admin interface, such as unused tabs, dashboard widgets, footer attributions – and Update Notifications.

You can install the plugin by searching under Plugins – Add New, or download it from the official WordPress repository here: https://wordpress.org/plugins/zen-dash

The project is also on GitHub: https://github.com/versluis/Zen-Dash

Creating a Podcast Feed with WordPress and PowerPress – Part 3

In this final episode of this mini series I’ll show you how to configure the first episode of your Podcast Feed by adding the audio file to the post. I’m also talking about the implications of setting the date and time on the post so that all your post-dated episodes appear in the correct order. Finally, we’ll submit our validated feed to the Apple Podcasts directory.

How to make turn URLs into clickable links in the_content()

The P2 theme has a nice feature built-in: the ability to turn URLs into clickable links on the fly. It does this by using a WordPress built-in function called make_clickable().

Here’s how we can use this function to make this feature available to any theme.

The above code, once inserted into your child theme’s functions.php file, will take the_content(), pass it to the make_clickable() function, and then return it before it’s printed on the screen.

The advantage of using it this way is that no content in the database is modified, and it’s easy to remove this feature when it’s not needed anymore. Feel free to add conditions depending on categories or other factors (you could check if the string “http” is present in the_content(), or only do this with .com endings, etc).

Learn more about this function here: https://codex.wordpress.org/Function_Reference/make_clickable

How to enable the Author Bio Box in TwentyThirteen

The TwentyThirteen theme has a built-in option to display an Author Bio Box underneath each post. It’s nicely formatted and can be implemented very easily – if only their authors would mention that this feature even exists, let alone how to activate it.

To understand how it works, we need to take a peek at the content.php file in the theme. Around line 70 we see three conditions that need to be met for the box to show up:

  • is_single() – the post needs to be a single post, not a page
  • get_author_meta(‘description’) – in your WordPress Profile, some text needs to be present in the description box
  • is_multi_author() – more than one author must be present on this WordPress installation

This means that on regular multi-user WordPress sites, TwentyThirteen will display the Bio Box automatically underneath regular posts. To make this happen on sidle-user sites, it is enough to create a second dummy user – on some installations at least. In my tests this doesn’t work reliably though (don’t ask me why – I’m just the messenger).

To make this work regardless of which mood WordPress appears to be in, we can also tweak this line and remove the third (multi-user check) condition like this:

Now we’ll see the Author Bio Box for single users as well!

Note however that there’s one more bit of inappropriateness that we may want to remove, namely a link to “all posts by this author”. That line just ruins everything for me. Not to worry, we can take care of this in a file called author-bio.php.

Towards the end at around line 30 we’ll see that this line and link is printed with a printf() statement. Comment it out and that link is gone.

Demo Theme

For a fully working demo with many other bells and whistles, check out two of my tweaked child themes on GitHub. They both have the above implementation:

Thanks to the suggestions in this forum post

How to remove the Jetpack Feedback Tab

In this episode I’ll explain how we can hide the Feedback Tab that the Jetpack plugin adds to the sidebar of the admin interface in WordPress. This tab is part of the Contact Form feature, which sadly cannot be switched off with a single slider. We’ll have to delve into debug mode and do it “the hard way” – but fear not, there’s not code hacking involved, and I’ll be with you every step of the way.

If you have any questions, please let me know.

How to hide WordPress Update Notifications with ZEN DASH

In this episode I’ll show you how to hide and remove those (almost daily occurring) WordPress Update Notifications. I’ve built this functionality into a plugin I’ve written over 5 years ago called ZEN DASH. The plugin’s main purpose is to hide all kinds of clutter from the WordPress admin interface, such as unused tabs, dashboard widgets, footer attributions – and Update Notifications.

You can install the plugin by searching under Plugins – Add New, or download it from the official WordPress repository here: https://wordpress.org/plugins/zen-dash

The project is also on GitHub: https://github.com/versluis/Zen-Dash

How to add something to the_content in WordPress using PHP

Sometimes we need to add additional text or elements to the_content in WordPress. This can include links, icons, shout outs, author biographies, and so forth. I wanted to add an Apple Podcasts badge underneath each post in my podcast categories, adding a link to the badge, depending on the category. I’ll elaborate how I did this in a later post.

Right now, let’s have a look at how we can add elements to the content retrieved from WordPress. This should work independently of your theme, and no theme-file-hacking is necessary to accomplish this.

All we need to do is intercept the_content as it is requested, append our elements and return an amended version of the_content. Let’s see how this works.

Continue reading How to add something to the_content in WordPress using PHP

How to bring back the date on Sticky Posts in TwentyThirteen

By default, the TwentyThirteen theme suppresses the date byline when a post is marked as Sticky (in which case, it’ll always be displayed at the top of the posts list).

That’s usually great, because Sticky Posts are often timeless announcements, and the fact that they’re a year or two out of date doesn’t look as handsome as if the date byline would simply be removed. I like this as a default behaviour.

Here’s what a default sticky post looks like, without the date displayed:

But of course, every now and again you may want to break the rules and shake up the whole universe. I did this on my iOS Dev Diary recently, where an announcement post would have been very helpful with the date displayed (I didn’t intent to keep it there for long).

So how do we bring back the date on Sticky Posts in TwentyThirteen? Let’s find out!

Continue reading How to bring back the date on Sticky Posts in TwentyThirteen

How to bring back the Author Byline in TwentyThirteen

I could have sworn that when I started using Automattic’s TwentyThirteen theme over five years ago, it displayed an Author Byline in the meta description. That’s the text right underneath the title of a post, the same line that displays the post date, categories and tags.

I remember this because there were many an instance on which I had to hide that Author Byline, because on single author websites, crediting yourself over and over again just leads to a cluttered reading experience. Furthermore, if you have several tags and categories to display, the meta line can easily run over into a second line, adding to more clutter than we want to see.

Turns out that over time, the WordPress team have had a lot of feedback about the Author Byline, and it turns out that nine times out of ten, people just didn’t want to see it. So they decided to invisibilise it by default.

Thanks to David Greene and P. Chandra for bringing this to my attention.

Let’s take a look at two options that can bring it back in TwentyThirteen. Continue reading How to bring back the Author Byline in TwentyThirteen