Hi friends,
I realized that the author´s page doesn´t list the custom post types, just the posts, right?
Is there a simple way to hook it?
Thanks!
Hi friends,
I realized that the author´s page doesn´t list the custom post types, just the posts, right?
Is there a simple way to hook it?
Thanks!
I tryed the code below... It is almost working fine... it makes a loop in each post type and print all posts from that post type...
The problem is that the query doesn´t respect the author=$authorID parameter and gets all posts from all authors...
I tryed the query without the post types loop and the author=$authorID parameter works fine... so, I think the variable is been lost when the post type loop begins...
Any help?? Thanks!!
<div class="entry-content">
<?php
$authorID = $authordata->ID;
$post_types=get_post_types();
foreach ($post_types as $post_type ) {
$query= 'author=' . $authorID. '&post_type=' . $post_type . '&orderby=post_date&order=desc'; // concatenate the query
query_posts($query); // run the query
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div id="artigos">
<div id="artigos_data"><?php the_time('j F'); ?></div>
<h2 class="artigo"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div id="linha"></div>
</div>
<?php endwhile; else:
endif;
}
//Reset Query
wp_reset_query(); ?>
</div>Any help ???
I realized that the $authorID = $authordata->ID is getting no data here... the problem is with the $authordata->ID
Solved!
I used this code to get the Author info:
<?php if(isset($_GET['author_name'])) :
$curauth = get_user_by('slug', $author_name);
else :
$curauth = get_userdata(intval($author));
endif; ?>
With that, I used it to get the user ID:
<?php $authorID = $curauth->ID; ?>
That is it!
MAN, Thanks a million ...
I spent days searching and trying to solve this problem with no solutions at all.
I was trying to find why the stupid loop can't get the posts that is posted in custom post types? it seems there is still a problem with wordpress custom post types.
anyway now the problem is fixed and I can get the author posts ... Thanks to you
you rock ...
Hi!
Thanks a million too! It almost fit what i needed!
I just wanted to know if there is a way of showing just one type of custom-post-type, and exclude de regular posts. Lets say I wanted to show the "products" custom-post-type only.
Can you help me, please? I tried a plenty of thing that didn't work.
Hi
Heads up changes to Thematic are coming that may affect you. This specifically has to do with how thematic will be handling custom post type archives and author archives.
You might want to test the current build in the svn against your child theme mods.
-Gene
This topic has been closed to new replies.