M
M
mrWan2018-03-25 19:58:33
WordPress
mrWan, 2018-03-25 19:58:33

How to pick up from get_custom_logo function?

The_custom_logo and get_custom_logo functions return html code. Maybe there is an easy way to pull a direct link to the image without resorting to regular expressions, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Yanchevsky, 2018-03-25
@mrWan

Try like this:

$custom_logo_id = get_theme_mod( 'custom_logo' );
$image = wp_get_attachment_image_src( $custom_logo_id , 'full' );
echo $image[0];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question