Archived topic
Author CSS styling
6 replies · Started by Matthias on August 20, 2020
Hi,
I am adding the author using the hook
<?php
global $post;
$author_id = $post->post_author;
?>
<p>von <?php printf( get_the_author_meta( 'display_name') );?></p>
for the blog posts.
Now I am trying to style the output. In particular I want it smaller and less distance to the line above and below.
I could not figure out the right CSS code for that.
Thank you for any guidance,
Matt
Hi there,
Any chance you can link us to the site in question?
You can edit the original topic and use the private URL field.
Let me know :)
Hi Leo,
e.g. https://heilfasten-portal.com/fachartikel-fasten/darmentleerung-entschlacken.html
Its about the author name in the beginning...
All the best and thank you!
Ps. Idealy the size of the author name is the same like the last modified date and directly underneath it.
Can you try changing the code to this?
<?php
global $post;
$author_id = $post->post_author;
?>
<p class="custom-author">von <?php printf( get_the_author_meta( 'display_name') );?></p>
Thank you Leo,
this one worked. I created the CSS with this class, all fine!
All the best,
Matt
Glad to hear :)