Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #981362

    Hello Mike, Yigit,

    Thanks for your help on the previous topic. Now I would like to add a second page with a different logo again. I have tried to adjust the PHP page myself and inserted the below code at the bottom of the functiions.php file, but got a blank screen again.

    Can you check if this code is correct?
    Thanks, Aram

    ———

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if (is_tree(3551)) 
    {
    	$logo = "http://preview.rooff.nl/wp-content/uploads/2018/06/rooff-logo-production.png";
    }
    
        return $logo;
    • This topic was modified 6 years, 3 months ago by steenvreter.
    #982061

    Hey steenvreter,

    Can you please check server log for error?

    Can you give us temporary admin access to your website (WP dashboard) in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #982403

    Hi Victoria,

    login details are below.

    Thanks,
    Aram/Steenvreter

    #982536

    Hi,
    The reason your code didn’t work was because the “is_tree” is for pages with parents, but the “production” page doesn’t have a parent, so I added a “elseif” & “is_page” for the production page.

    
    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if (is_tree(1406)) 
    {
    	$logo = "http://preview.rooff.nl/wp-content/uploads/2018/07/rooff-logo-mngmnt.png";
    } elseif ( is_page(3551) ) {
      $logo = "http://preview.rooff.nl/wp-content/uploads/2018/07/rooff-logo-production.png";
    }
    
        return $logo;
    }
    

    Please clear your browser cache and check.

    Best regards,
    Mike

    #982538

    And one curly bracket is missing on your code above.
    One closes the if clause – and the second closes the function ( after return logo – as mikes code above)

    #982542

    so for a list of page you can use array or to exclude one page the is not

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo){
        if( is_page(21) ) {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage21.jpg"; 
        }
        elseif ( is_page( array( 42, 54, 6 ) ) ) {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage22.jpg"; 
        }
        elseif ( is_page() && !is_page(1307) )  {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg";  
        }
        return $logo;
    }
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.