Autor avatar
This topic contains 16 replies, has 3 voices, and was last updated by Giri 8 years, 1 month ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
September 12, 2017 at 12:34 pm #395309
Hi, is there an opportunity to post Author Avatar here?
I must change listing view.php?September 12, 2017 at 4:55 pm #395353It’s possible ?
September 12, 2017 at 5:40 pm #395368Hi Elena,
no need to bump threads, we read them all and we guarantee and answer within 24 hours. https://wpgeodirectory.com/support-policy/
I believe that can be done with a code snippet using hooks, a developer will let you know asap.
Thanks for your patience,
September 12, 2017 at 5:48 pm #395370Hi Elena,
You should use a custom snippet like this.
add_action('geodir_after_listing_post_title', 'avatar_geodir_after_listing_post_title'); function avatar_geodir_after_listing_post_title($view, $post) { $author_id = $post->post_author; echo get_avatar( $author_id, 60 ); }Install this plugin, add the above snippet and then make sure to activate the snippet.
https://wordpress.org/plugins/code-snippets/
Let me know how that goes.
Thanks
PS: you may have to add soke custom css to style that part.
September 12, 2017 at 6:06 pm #395371Yes its work , but i have only avatar img without link , can I do the link for author page ?
September 12, 2017 at 6:09 pm #395372Just as it was done on listing detail page
September 12, 2017 at 6:13 pm #395373add_action('geodir_after_listing_post_title', 'avatar_geodir_after_listing_post_title'); function avatar_geodir_after_listing_post_title($view, $post) { $author_id = $post->post_author; $author_link = get_author_posts_url($author_id); $entry_author = get_avatar( $author_id, 60 ); printf('<div class="author-avatar"><a href="%s">%s</a></div>', esc_url($author_link), $entry_author); }September 12, 2017 at 6:34 pm #395377Link don’t work
September 12, 2017 at 6:52 pm #395382Giri took off for the night, but he’ll get back to you tomorrow morning 1st thing.
Thanks for your patience.
September 13, 2017 at 10:32 am #395480Hi Elena,
I’m not sure what you mean link don’t work. You mean there is no link or pointing to incorrect page?
Its better if you give me the page url where i can see that avatar in a private reply.
Thanks
September 13, 2017 at 10:39 am #395483I put this shippet , but all i can see- is author avatar without image and without link for author page
September 13, 2017 at 10:44 am #395484Hi Elena, Did you replace my old snippet with the new one or you use both snippets?
September 13, 2017 at 10:49 am #395485Hi Elena,
You can try this code if the previous doesn’t work.
add_action('geodir_after_listing_post_title', 'avatar_geodir_after_listing_post_title'); function avatar_geodir_after_listing_post_title($view, $post) { $author_id = $post->post_author; $author_link = get_author_posts_url($author_id); $entry_author = get_avatar( $author_id, 60 ); echo sprintf('<div class="author-avatar"><a href="%s">%s</a></div>', esc_url($author_link), $entry_author); }But i cannot give you more assistance without looking at your page.
September 13, 2017 at 12:28 pm #395495This reply has been marked as private.September 13, 2017 at 12:33 pm #395496Not sure how that works. The $user_id variable coming from out of nowhere.
But if it works for you then its fine.
Thanks for letting me know.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket