1

Update:

Ok,the DEBUG log says:

PHP Notice:  Undefined offset: 0 in /home/content/00/8437600/html/test/wp-includes/query.php on line 3105

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3939

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3941

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3943

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3944

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3952

PHP Notice:  Trying to get property of non-object in /home/content/00/8437600/html/test/wp-includes/query.php on line 3967

NOTE:

At the top of my author.php I use the following code in order to get user meta for the page:

<? $curauth = (get_query_var('author_name')) ? get_user_by('slug',    
    get_query_var('author_name')) :    
    get_userdata(get_query_var('author'));
?>

End of update

Original Post

First - I am teaching myself how to write php and am also new to this forum.

I am trying to follow the instructions from the top answer for this question Author page: Comments and Ratings? to add comments to author.php - without any luck.

The following is the steps I have taken:

  1. Created a custom post type to hold the comments
  2. Created a new post in said post type
  3. Created custom field in user meta called -> author_post_id
  4. Added newly created post id to user meta for particular user Note: this works because I can add echo statement in the code provided and the above link and it echos the correct post id so I know I did something write (lol)
  5. Copy/pasted the code given on the above link (answer #3) into my author.php

Nothing is showing up. What am I missing?

I even added wp_reset_query(); after the loop that displays post by the author and it made no difference.

Here is my test author page http://test.thesingleparentperspective.com/author/ckmatthews/

  • Have you enabled debugging? – s_ha_dum Apr 6 '14 at 19:58
  • This really shows my newbiness but no - I don't know how. – C.K. Matthews Apr 6 '14 at 20:34
  • Then follow the link and follow the instructions :) – s_ha_dum Apr 6 '14 at 20:41
  • Please clean up the question. It is now a bit confusing. You do not need to keep information that is no longer relevant. – s_ha_dum Apr 6 '14 at 21:45
  • Is that better? – C.K. Matthews Apr 6 '14 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.