I am using Taxonomy Thumbnail plugin to display category thumbnail, the plugin is working fine but I just want to get the url of image so that I can display it as a background image.
I have tried the following code but still it gives this format:
<img width="1024" height="618" src="https://example.com/wp-content/uploads/2019/07/Kathmandu-lumbini.jpg" class="attachment-post-thumbnail size-post-thumbnail" alt="kathmandu Pokhara Lumbini tour" srcset="https://example.com/wp-content/uploads/2019/07/Kathmandu-lumbini.jpg 1024w, https://example.com/wp-content/uploads/2019/07/Kathmandu-lumbini-300x181.jpg 300w, https://example.com/wp-content/uploads/2019/07/Kathmandu-lumbini-768x464.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px">
$background = wp_get_attachment_url(the_term_thumbnail( $term_taxonomy_id, $size = 'post-thumbnail', $attr = '' ));
My expected output would be
https://example.com/wp-content/uploads/2019/07/Kathmandu-lumbini.jpg