Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • in reply to: Author.php for custom post type #45399
     jorasik
    Participant

    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 CODE
    function 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');
    in reply to: Author.php for custom post type #45382
     jorasik
    Participant

    Yes, 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?

    in reply to: Private message button #45292
     jorasik
    Participant

    Super cool! 🙂 I believe it will do perfect job. Can’t wait for the release! 🙂
    Thanks for the fast response!

    in reply to: Private message button #45280
     jorasik
    Participant

    Hey 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 ?

Viewing 4 posts - 1 through 4 (of 4 total)

Log in with your credentials

Forgot your details?