Site logo

Archived topic

Upload logo image manually, how the theme can identify the logo image ?

7 replies · Started by Budi on January 15, 2021

Viewing posts 1–8 of 8

Hello,

I want to upload the logo image in /images folder manually, how the theme can identify that file as the logo image ?

Thanks.

Hi there,

you have to assign the Logo in the Customizer > Site Identity.

Is it possible to upload logo file using ftp and assign manually ?
I do not want additional record in wp_posts table.

Thanks.

You can do this:

add_filter( 'generate_logo', function() {
    return 'THE URL TO YOUR LOGO';
} );

add_filter( 'generate_logo', function() {
return 'THE URL TO YOUR LOGO';
} );

I place the above code in functions.php file ?

for 'THE URL TO YOUR LOGO', which one ?

'www.mydomain.com/images/logo.jpg' or '/images/logo.jpg'

Thanks.

Hi,

add_filter( 'generate_logo', function() {
return 'www.mydomain.com/images/logo.jpg';
} );

or

add_filter( 'generate_logo', function() {
return '/images/logo.jpg';
} );

Should work fine.

I place the above code in functions.php file ?

Here's how to add PHP - https://docs.generatepress.com/article/adding-php/

So to answer the question, yes you can place it on the bottom part of the functions.php of your child theme.

Placing it in the functions.php of the parent theme has its risks because any changes you've made there will be wiped when the plugin updates.

hello,

now it works.
the first row is add_filter( 'generate_logo', function( $logo ) {

Thanks.

No problem. Glad it works for you. :)

This archived topic is closed to new replies.