How to customize the per-post authoring byline in Wordpress

By: ( +David Herron; Date: Mon Apr 06 2015 17:00:00 GMT-0700 (PDT)

Tags: Wordpress

As a new Wordpress site owner, I'm going over every detail of the presentation to make sure everything looks right. This evening the task is improving the per-post publishing byline, and author information. As a side task, I want to have the site display my full name anywhere it would normally show the user login name. My theory is that because my mother named me "David Herron" and not "webmaster" that my website shouldn't show my name as "webmaster".

The format of the per-post byline (a.k.a. "This entry was posted in EV Charging and tagged Fast Charging, SAE DC Fast Charge, Supercharger on April 6, 2015 by David Herron.") is controlled by the theme. You should start in content.php for your theme. I'm using a child theme of the twentytwelve theme, and the author information is with this section:

<footer class="entry-meta">

The "This entry was posted in .." text is generated in the twentytwelve_entry_meta function, located in functions.php. Finally the presentation of the login name or full name is controlled by calling the Wordpress function get_the_author.

Studying the documentation for the get_the_author Wordpress API function tells us a simple way to control the string that function returns. Simply go to the User Profile page and change the Display Name setting.

That's cool - one setting and it changes the displayed name across the whole site, not just in the per-post byline.

With that out of the way let's move on to the other task - getting a nice looking author bio at the bottom of the post.

The first thing to try is right in front of us on the user profile page. There's a box labeled "Biographical Information" into which you can write a bio statement.

Going back to content.php we see that if the user has entered "Biographical Information", an author bio automagically appears. It links to the author profile page and that page has a list of recent posts including other information.

We could declare done at this point but there's some additional choices available to us.

Head over to the Plugins area in the dashboard, and click on Add New. Then enter "Author" in the search box and hit return. There are hundreds of plugins that show up. Fortunately most of them don't work against WP 4.1.1, which sure narrows down the number of plugins to look at.

The two I ruled out are Sexy Author Bio and StarBox. Both create a block at the bottom of the post with different levels of customization. They're nice because the presentation can be customized from the settings. But at the end of the day neither are functionally better than the default author bio display supported by the twentytwelve theme.

WP Author Box Lite does the same, but offers a significantly useful feature - a customizable list of icons linking to social network profiles.

In your User Profile page are boxes for links to your profile pages on social networks. It's not just the popular networks (Facebook et al) but some of the not-so-popular ones. Dribble anyone?

In the admin screen the administrator selects the networks supported by the site. Then in the User Profile screen, the user enters their desired social network profile links. The generated author bio box then shows only the icons for which the user gave links.

But, wait, there are now two author bio boxes. What's going on is the default bio box generated by the theme is showing, as is the WP Author Box Lite. Fixing this is simple, in content.php edit this line:

<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : ...

Contained within that "if" statement is the code for the author bio box. What I did is simply to add "false" like so:

<?php if ( false && is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : ...

Here's the result:

« Russia's Propaganda Machine -- Vice News Mounting Dropbox, SFTP and other remote filesystems on ChromeOS »
2016 Election Acer C720 Ad block AkashaCMS Amazon Amazon Kindle Amiga Android Anti-Fascism Apple Apple Hardware History Apple iPhone Apple iPhone Hardware April 1st Arduino ARM Compilation Astronomy Asynchronous Programming Authoritarianism Automated Social Posting Ayo.JS Bells Law Big Brother Big Finish Black Holes Blade Runner Blogger Blogging Books Botnet Botnets Cassette Tapes Cellphones Christopher Eccleston Chrome Chrome Apps Chromebook Chromebooks Chromebox ChromeOS CIA CitiCards Citizen Journalism Civil Liberties Clinton Cluster Computing Command Line Tools Computer Hardware Computer Repair Computers Cross Compilation Crouton Curiosity Rover Cyber Security Cybermen Daleks Darth Vader Data backup Data Storage Database Database Backup Databases David Tenant DDoS Botnet Detect Adblocker Developers Editors Digital Photography DIY DIY Repair DNP3 Docker Doctor Who Doctor Who Paradox Drobo Drupal Drupal Themes DVD E-Books E-Readers Early Computers Election Hacks Electric Bicycles Electric Vehicles Electron Emdebian Energy Efficiency Enterprise Node EPUB ESP8266 Ethical Curation Eurovision Event Driven Asynchronous Express Facebook Fake News Fedora VirtualBox File transfer without iTunes FireFly Fraud Freedom of Speech Gallifrey git Gitlab GMAIL Google Google Chrome Google Gnome Google+ Government Spying Great Britain Heat Loss Hibernate Home Automation HTTPS I2C Protocol Image Analysis Image Conversion Image Processing ImageMagick InfluxDB Infrared Thermometers Insulation Internet Internet Advertising Internet Law Internet of Things Internet Policy Internet Privacy iOS Devices iPad iPhone iPhone hacking Iron Man Iternet of Things iTunes Java JavaScript JavaScript Injection JDBC John Simms Journalism Joyent Kindle Marketplace Lets Encrypt LibreOffice Linux Linux Hints Linux Single Board Computers Logging Mac OS Mac OS X MacOS X setup Make Money Online MariaDB Mars Matt Lucas MEADS Anti-Missile Mercurial Michele Gomez Micro Apartments Military Hardware Minification Minimized CSS Minimized HTML Minimized JavaScript Missy Mobile Applications MODBUS Mondas MongoDB Mongoose Monty Python MQTT Music Player Music Streaming MySQL NanoPi Nardole NASA Net Neutrality Node Web Development Node.js Node.js Database Node.js Testing Node.JS Web Development Node.x North Korea Online advertising Online Fraud Online Journalism Online Video Open Media Vault Open Source Governance Open Source Licenses Open Source Software OpenAPI OpenVPN Personal Flight Peter Capaldi Photography PHP Plex Plex Media Server Political Protest Postal Service Power Control Privacy Production use Public Violence Raspberry Pi Raspberry Pi 3 Raspberry Pi Zero Recycling Remote Desktop Republicans Retro-Technology Reviews Right to Repair River Song Robotics Rocket Ships RSS News Readers rsync Russia Russia Troll Factory SCADA Scheme Science Fiction Season 1 Season 10 Season 11 Security Security Cameras Server-side JavaScript Shell Scripts Silence Simsimi Skype Social Media Warfare Social Networks Software Development Space Flight Space Ship Reuse Space Ships SpaceX Spear Phishing Spring Spring Boot SQLite3 SSD Drives SSD upgrade SSH SSH Key SSL Swagger Synchronizing Files Telescopes Terrorism The Cybermen The Daleks The Master Time-Series Database Torchwood Total Information Awareness Trump Trump Administration Ubuntu UDOO Virtual Private Networks VirtualBox VLC VNC VOIP Web Applications Web Developer Resources Web Development Web Development Tools Web Marketing Website Advertising Weeping Angels WhatsApp Window Insulation Wordpress YouTube