Better php
-
This may well not be the right place for this question, but it’s worth a try. I’ve been playing around with having my site do this:
<?php $author = get_the_author(); if ( $author != 'admin' ) { print 'Guest blogged by <a href="'; echo get_author_link( false, $authordata->ID, $authordata->user_nicename ); print '" title="'; printf( __( 'View all posts by %s', 'themename' ), $authordata->display_name ); print '">'; the_author(); print '</a>'; } else { print 'something else' } ?>
Regardless if that’s the best way to do what I’m doing, is there a better way to code this? Coming in and out of print to include php stuff within the IF statement seems really long winded and messy.
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Better php’ is closed to new replies.