Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have the following code:

/*Get number of entries*/
    function get_entries_num( $id ) {
        $count=  count_user_posts( $id );
        if ($count == 1) 
        {
            return sprintf(__('%s total post','upme'), $post, $count);
        } else 
        {
            return sprintf(__('%s total posts','upme'), $count);
        }
    }

I want to link "%s total posts" this location get_author_posts_url($author_id).

So, I want to display WordPress user all post(author page) when someone click on "%s total posts".

share|improve this question
add comment

1 Answer 1

Have you tried something like:

/*Get number of entries*/
function get_entries_num( $id ) {
    $count=  count_user_posts( $id );
    if ($count == 1) 
    {
        return '<a href="'.get_author_posts_url($id).'">'.sprintf(__('%s total post','upme'), $count).'</a>';
    } else 
    {
        return '<a href="'.get_author_posts_url($id).'">'.sprintf(__('%s total posts','upme'), $count).'</a>';
    }
}
share|improve this answer
    
wow this is working. thanks you sooooooooooooo much :D:D:D –  Technology Blog Sep 9 '13 at 16:02
    
You are wellcome. You should mark the question as resolved indeed. –  cybmeta Sep 9 '13 at 19:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.