Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1121844

    Hi there!

    I want to change the logo on several pages. Found in this forum an answer:

    Open up wp-contentthemesenfoldframeworkphpfunction-set-avia-frontend.php and replace:

    $logo = "<img src=".$logo." alt='' />";
    with

    if(is_page('25')) $logo = 'http://mywebsite.com/second_logo.jpg';
    $logo = "<img src=".$logo." alt='' />";

    But I can’t find the php file. Does it still excist? It’s an answer from 2013! If it does, where to find?

    I also tried changing the logo with CSS but it’s not totally working. I added some CSS for my default logo:

    .responsive .logo {
    display: block !important;
    }
    
    .logo, .logo a {
    overflow: visible !important;
    }
    
    .logo img {
    height: 250%; 
    max-height: 360px !important;
    }
    
    .logo {
    margin-top: -100px;
    margin-left: -200px;
    }
    
    #header_main {
    z-index: 20;
    }

    Now I want to change logo on specific page. Tried this:

    .page-id-121 .logo img {
    position: absolute;
    height: 250%; 
    max-height: 360px !important;
    }
    
    .page-id-121 .logo {
    background: url(https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png) no-repeat center;
    display: block;
    height: 100px;
    width: 300px;
    margin-top: -100px;
    margin-left: -200px;
    }

    I see the logo is visible but totally not on the right place and it’s only visible in the top header. See link in private data! Also the default logo is still visible. Do you have any idea how to change this? It must be done at multiple pages!

    Love to hear from you!

    Janneke

    • This topic was modified 5 years, 3 months ago by jannnnnneke.
    #1121953

    if you are using a child-theme ( and i alway recommend that) you can replace the logo by adding something like this to your child-theme functions.php

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo){
        if( is_page(121) ) {
        	$logo = "https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png"; 
        }
        return $logo;
    }

    btw: you can have more substitutions like this way with all conditional possiblities you like:

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo){
        if( is_page(121) ) {
        	$logo = "https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png"; 
        }
      
        if ( is_page( array( 42, 54, 6 ) ) ) {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage22.jpg"; 
        }
    
        if ( is_page() && !is_page(1307) )  {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg";  
        }
        return $logo;
    }

    etc. pp.

    #1122053

    Hi,

    Thanks for helping out @guenni007, did that answer your question @jannnnnneke?

    Best regards,
    Rikard

    #1126754

    Yes, perfect!

    How can I change the logo for portfolio items? That ID isn’t working (post id: 338).

    Thanks!

    #1128165

    Hi,

    I checked your site but the cache is enabled. Please follow the steps mentioned in the previous ticket and clear the cache.

    Once the cache is cleared you should be able to view the changes correctly.

    If yous till have any issue please share the link to the portfolio item page so we can take a closer look at it.

    Best regards,
    Vinay

    #1129230

    Hi there,

    I cleared cache but didnt work.

    I tried adding CSS for specific page and that also didn’t work for the portfolio items. See https://kriesi.at/support/topic/changing-header-color-for-only-one-page/#post-1129229

    Thanks!

    #1129835

    Hi,

    Thank you for the update.

    You need to use the “is_single” conditional function instead of “is_page” for portfolio items.

    // https://developer.wordpress.org/reference/functions/is_single/

    Best regards,
    Ismael

    #1129996

    Yes, perfect!! “is_single” is working!

    Thanks Ismael!

    #1130190

    Hi,

    Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1139139

    Is it possible to change the link of logo? Now all the logo’s are going to homepage when you click on it. But i would like to change that on a few pages. I’m using the function.php code guenni007 sent!

    Thanks a lot!

    #1139782

    Hi,

    Yes, that’s possible. You can use the “avf_logo_link” filter for that. An example can be found in the following thread.

    // https://kriesi.at/support/topic/different-logo-for-different-websites-subpages/

    Thank you for the update.

    Best regards,
    Ismael

    #1317192

    It’s not working for me – I changed the page number – Changed the link and added to the child PHP functions… what am I missing?
    I want this logo: https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png
    On this page only: https://www.vfsfire.com/national/
    Added this code:
    add_filter(‘avf_logo’,’av_change_logo’);
    function av_change_logo($logo)
    {
    if(is_page(830) )
    {
    $logo = “https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png&#8221;;
    }
    return $logo;
    }
    Screenshot of the PHP child functions page with code added
    https://www.vfsfire.com/wp-content/uploads/2021/08/Screen-Shot-2021-08-17-at-9.13.07-AM.png

    #1317393

    OK, how long should I usually wait for a reply. Got help: This worked:

    add_filter(‘avf_header_setting_filter’,’avf_header_setting_filter_mod’);
    function avf_header_setting_filter_mod($header)
    {
    if( is_page(‘830’) ){
    $header[‘header_replacement_logo’] = “https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png&#8221;;
    }
    return $header;
    }

    Still doesn’t work on mobile but I’ll take 50%.

    #1317435

    Hi,

    You might have set your page to have a transparent header, which is why the previous filter did not work. Is that the case? If you need more help, please feel free to open a new thread.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Change logo on specific pages’ is closed to new replies.