Title: Custom fields problem
Last modified: August 20, 2016

---

# Custom fields problem

 *  Resolved [Stergos](https://wordpress.org/support/users/stergos/)
 * (@stergos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/)
 * Hi, i’m using twenty eleven theme (child) and i am trying to change the author
   name and link from a post by using custom fields. I create 2 new custom fields
   with the name “customauthor” and “customauthorlink” but the author name and link
   is not change the name is still remain admin. I guess i need to place a code 
   to some .php file, can anyone give me some advice please? Thank you so much!
 * Post link: [http://www.e-hacking.com/articles/hacking-wii/](http://www.e-hacking.com/articles/hacking-wii/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [Stergos](https://wordpress.org/support/users/stergos/)
 * (@stergos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2367981)
 * After a lot of search i find out that i need a lot things to do but i don’t have
   any idea how. I try to add <?php the_meta(); ?> to single.php but this just place
   as a text customauthor and customauthorlink to the end of the page. I want to
   replace “admin” with a new author and link.
 * Please if someone has any idea what i need to do just reply, thank you!!!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2367983)
 * Try it with this insite the loop [untested]:
 *     ```
       <?php
       $author = get_post_meta($post->ID, 'customauthor', true);
       $authorlink = get_post_meta($post->ID, 'customauthorlink', true);
       if($author != '' && $authorlink != '') :
       ?>
       <a href="<?php echo $authorlink; ?>"><?php echo $author; ?></a>
       <?php endif; ?>
       ```
   
 *  Thread Starter [Stergos](https://wordpress.org/support/users/stergos/)
 * (@stergos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368089)
 * Hey keesiemeijer, thanks for reply! Inside the loop i guess you mean “loop.php”
   which is not exist to twenty eleven theme! Anywhere else i can place it?
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368102)
 * Ok forget that code.
 * Do not edit the Twenty Eleven theme. It is the default WordPress 3.2 theme and
   having access to an **unedited** version of the theme is vital when dealing with
   a range of site issues. [Create a child theme for your changes](http://codex.wordpress.org/Child_Themes).
 * in your child theme content-single.php change this:
 *     ```
       printf(
       $utility_text,
       $categories_list,
       $tag_list,
       esc_url( get_permalink() ),
       the_title_attribute( 'echo=0' ),
       get_the_author(),
       esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
       );
       ```
   
 * to this:
 *     ```
       $author = get_post_meta($post->ID, 'customauthor', true);
       $authorlink = get_post_meta($post->ID, 'customauthorlink', true);
       $author = ($author != '') ? $author : get_the_author();
       $authorlink = ($authorlink != '') ? $authorlink  : esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );
       printf(
       $utility_text,
       $categories_list,
       $tag_list,
       esc_url( get_permalink() ),
       the_title_attribute( 'echo=0' ),
       $author,
       $authorlink
       );
       ```
   
 *  Thread Starter [Stergos](https://wordpress.org/support/users/stergos/)
 * (@stergos)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368127)
 * Jesus keesiemeijer I would not able to do this even in 100 years, thanks A LOT
   my friend thank you!!!!!!!
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368156)
 * No problem. Gad you got it resolved.
 *  Thread Starter [Stergos](https://wordpress.org/support/users/stergos/)
 * (@stergos)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368349)
 * Hey mate, the previous code is help me to change the author name to the bottom
   of the page “This entry was posted in Articles by Barbara. Bookmark the permalink.”
   but there is also this “Posted on February 4, 2012 by admin ” to the top of the
   page below the title, is there any way to show “Barbara” like to the bottom? 
   This is [my link](http://www.e-hacking.com/articles/) to see that online, Thanks
   a lot!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Custom fields problem’ is closed to new replies.

## Tags

 * [author](https://wordpress.org/support/topic-tag/author/)
 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [Stergos](https://wordpress.org/support/users/stergos/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/custom-fields-problem-4/#post-2368349)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
