Skip to content

Instantly share code, notes, and snippets.

@craigtommola
Last active July 31, 2019 14:55
Show Gist options
  • Save craigtommola/96854d235c4c6ffcf4b50b326d203d64 to your computer and use it in GitHub Desktop.
Save craigtommola/96854d235c4c6ffcf4b50b326d203d64 to your computer and use it in GitHub Desktop.
Wordpress Twenty Nineteen theme + ACF = Custom Byline
<!-- /template-parts/header/entry-header.php
Create ACF field for posts with text field named Custom Byline / custom_byline
Replace entry-header.php:16 with the below code
-->
<?php if (get_field('custom_byline') === '') { twentynineteen_posted_by(); } else { $custom_author = get_field('custom_byline'); echo '<span class="byline">
<svg class="svg-icon" width="16" height="16" aria-hidden="true" role="img" focusable="false" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"></path>
<path d="M0 0h24v24H0z" fill="none"></path>
</svg>
<span class="screen-reader-text">Authored by</span><span class="author vcard">'.$custom_author.'</span>
</span>'; } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment