smfisher
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Auto-update author (user) when post modified?Sweet, I will have to check out Quiver. I’ve been using dreamwever for as long as I can remember… It has a built in “snippets” panel. I may have to look at quiver though. 🙂
sf
- This reply was modified 9 years, 5 months ago by smfisher.
Forum: Fixing WordPress
In reply to: Auto-update author (user) when post modified?You bet! I guess I didn’t read your post close enough… I found your post when I was trying to show modified author in my posts… I did add some more logic by the way. I will post this here incase you need it in the future… I wanted to display the publish date and author, and then check to see if any updates had been done and if so, display that author. We have to have accountability here to as this is our internal resource for constantly updated documents in the practice.
<!-- DISPLAY ARTICLE PUBLISH DATE AND AUTHOR --> <?php _e( '<strong>Published </strong>' , 'knowall' ); ?> <?php the_time('M j, Y');?> by <a href="mailto:<?php print"$authordata->user_email";?>?subject=<?php the_title(); ?> Article in the KB"><?php the_author();?></a> <!-- END CREATED DATE DISPLAY --> <!-- DISPLAY LAST MOD AUTHOR INFO --> <!-- WRAP IN AN IF STATEMENT SO WE DON'T SHOW THIS UNLESS THERE HAS BEEN A MODIFICATION --> <?php if ( get_the_modified_time( 'U' ) > get_the_time( 'U' ) ) { //echo 'Last updated:' . get_the_modified_time(); print "|"; print _e( '<strong>Updated</strong>' , 'knowall' ); print the_modified_date('M j, Y'); print "by"; the_modified_author(); }//else we don't show the above block --> ?> <!-- END WRAPPED IF STATEMENT --> <!-- END DISPLAY LAST MOD AUTHOR INFO -->Forum: Fixing WordPress
In reply to: Auto-update author (user) when post modified?You can do something like this at the header or footer of your posts.
Published by <?php the_author();?> on <?php the_time(‘M j, Y’);?>
Updated <?php the_modified_date(‘M j, Y’); ?> by <?php the_modified_author(); ?>Which will give you something like the following:
Published by Will Ribera on Sep 15, 2016 | Updated Nov 26, 2016 by Scott Fisher