Forum Replies Created
-
Author
-
jorasikParticipant
I just managed to do it. It was a small mistake in the function from the first link. Now it works just fine for getting the author posts.
Here is what I am using, maybe someone else will need it too.
COPY CODEfunction custom_post_author_archive($query) { if ($query->is_author) $query->set( 'post_type', array('posttype1', 'posttype2') ); return $query; remove_action( 'pre_get_posts', 'custom_post_author_archive' ); } add_action('pre_get_posts', 'custom_post_author_archive');
jorasikParticipantYes, i already tried google and adding to the function.php the snipped of code with my custom post types, for some reason it is not working.
By default i assume it should fall to archive.php the one which is in the parent theme. Not working for me. I added an author.php with the same structure and it is not working too.
Any suggestions or directions?
jorasikParticipantSuper cool! 🙂 I believe it will do perfect job. Can’t wait for the release! 🙂
Thanks for the fast response!jorasikParticipantHey guys, I am trying to use this function to generate same button for private message as the one in the members loop so that when it is clicked it will populate the SENT TO field with the specific user name. In short I need to generate the button in to author box under specific custom post type.
It generated the link and it sends me to the form but it the auto-population of the field is not working, the link that is generated doesn’t contain the username.
It is supposed to be like that:
<a href="http://site.com/members/admin/messages/compose/?r=USERNAME&_wpnonce=aa6f4a1ca8" title="Send a private message to this user." class="send-message">Private Message</a>
But it is like this:
<a href="http://site.com/members/admin/messages/compose/?r&_wpnonce=aa6f4a1ca8" title="Send a private message to this user." class="send-message">Private Message</a>
Any ideas how to fix that ?
-
AuthorPosts