Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #668931

    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

    • This topic was modified 8 years, 3 months ago by Mark_goessens.
    #670216

    I forgot the mention the website URL. Maybe it’s useful: website

    #670423

    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

    #670743

    Hi Yigit,

    This code works perfect.
    Thanks for you help!

    Greets Mark

    #670756

    Hi,

    You are welcome! Let us know if you have any other questions or issues

    Best regards,
    Yigit

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Different logo per page with Advanced Custom Fields’ is closed to new replies.