Rewrite author name with custom field




Nothing hard with this recipe: Simply paste the following code on your single.php and page.php , where you want the author name to be displayed. <?php $author = get_post_meta($post->ID, "guest-author", true); if ($author != "") { echo $author; } else { the_author(); } Once done, you just have to create a custom field named guest-author and type your custom title as a value. Looking for WordPress hosting?


Direct Link

Your Ad Here

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>