[Resolved] Author.php just won’t work
Try as I might I can not understand how to get a working author profile page. I created author.php but any coding I use within it brings up nothing. I have searched and searched for an answer and came across this:
But I still do not understand what I am supposed to do once the plugin is installed adding:
<?php get_author_profile(auth_ID); ?>
ID being 1, brought up nothing.
I am currently using this:
<?php include “header.php”; ?>
<?php if(isset($_GET[‘author_name’]) || isset($_GET[‘author’])) :
$curauth = get_userdatabylogin($_GET[‘author_name’]);
$curauth = get_userdata($_GET[‘author’]);
<h3>You’re currently viewing <?php echo $curauth->user_firstname; ?> <?php echo $curauth->user_lastname; ?>’s page of posts:</h3>
<?php endif; ?>
With no effect.
I’d like a page which shows all users. Name, profile, possibly a pic etc on one page. Like this:
I’m very confused and would like a straight forward answer as to where I have gone wrong please.
Many thanks in advance.
you don’t need to create the page, so much as use the write page feature.
kafkaesqui is around, and that’s his plugin, so I’ll let him explain how to utilize it.
I wrote a page to use the feature in which does not work. I forgot to post it sorry.
I do know how to create pages and page templates but this one area is baffling me.
Paste the source for your author.php template here:
And reply back with the url you get. We’ll go from there.
Also, just to clarify: are you trying to set up an author.php, or a template for an author Page? They are not the same.
Paste.uni.cc does not work for me I’ll post it here seeing as it’s short:
http://paste.uni.cc/7498  it worked finally
I am trying do to do both I assume but since I have already created author.php I’m guessing it is the template that is the problem.
The isset($_GET[‘author_name’]) stuff will not work because you don’t pass an author_name/author query to the Page. The posts will also not show up.
Basically what you have there is for setting up an author.php — that is a template for author queries. author.php is what you could call a primary template, like archive.php or single.php, and is used when someone queries your blog by author, such as
So if I then create links as such
I will get a profile for my user??
How do I pass a user name to my profile page? I don’t understand that.
The easiest way to pass a user name to the author template is to use one of the following template tags
<?php the_author_posts_link(); ?>
<?php wp_list_authors(); ?>
<?php list_authors(); ?>
somewhere else on your site, such as in The Loop or on your sidebar. (The first template tag mentioned can only be used in The Loop.)
However, the author template is only meant to display information for one author at a time. If you want to show all your authors on the same page, I think you will have to do something similar to this thread. I am working on this at the moment. If you want to see what mine looks like, go here. It needs some work with the formatting of it, but it is basically doing what I want it to.
But I have been having trouble with the same piece of code as you are in my author template, as described in this thread. It works for some authors and not others, and I don’t know why.
Oh thank you Kathy! That worked great! It’s now working with a list of authors at the top of the page and the current users profile underneath.
Thanks a bunch 😀
- The topic ‘[Resolved] Author.php just won’t work’ is closed to new replies.