Hi Kriesi,
I want to give our client the ability to choose different logos per page.
I installed the Advanced Custom Field plugin, so that the user can upload a logo per page.
But the challenge is to place the code in the template.
I opened helper-main-menu.php
This line shows the logo:
$output .= avia_logo(AVIA_BASE_URL.'images/layout/logo.png', $addition, 'strong', true);
Can you tell me how I can change this line to show the image from Advanced Custom Field?
This is the line I have to implement:
<img src="<?php the_field('upload_image'); ?>" alt="" />
I tried this:
$output .= the_field('upload_image');
But it appears not to be that simple.
I hope you can help.
Greets Mark
I forgot the mention the website URL. Maybe it’s useful: website
Hi,
Please add following code to Functions.php file of your child theme
add_filter('avf_logo','av_change_logo');
function av_change_logo($logo){
$your_custom_logo = get_field('upload_image');
if($your_custom_logo !== "" )
{
$logo = $your_custom_logo;
}
return $logo;
}
Best regards,
Yigit
Hi Yigit,
This code works perfect.
Thanks for you help!
Greets Mark