Viewing 26 posts - 1 through 26 (of 26 total)
  • Author
    Posts
  • #872436

    Hello,

    May I at one sub-URL be able to display an other Logo?
    I would also like to show an other favicon at the same sub-URL.

    This is to display an other topic without a new web-hotel.

    May site of interest is now at norjob.no

    Kind regards!

    #872563

    Edit is it the link above than it is no page-id than it is your postid-4665

    both goes to function.php of child-theme

    1) Logo:

    add_filter('avf_logo','av_change_logo_url');
    function av_change_logo_url($url)
    {
        if( is_single('4665') )
        {
            $url = "https://url_of_your_domain/wp-content/uploads/logo2.png";
        }
        return $url; 
    }

    2) Favicon:
    i don’t think that it will overwrite the favicon set on enfold dialog – so you have to put it in this way and let the field on enfold dialog empty
    if you only want to have favicon use:

    add_action('wp_head', 'ava_add_iconnns');
    function ava_add_iconnns() {
    if( is_single(4665) ) {
    ?>
    	<link rel="shortcut icon" type="image/x-icon" href="https://url_of_your_domain/wp-content/uploads/favicon1.ico">
    <?php
    }
    if( !is_single(4665) ) {
    ?>
    	<link rel="shortcut icon" type="image/x-icon" href="https://url_of_your_domain/wp-content/uploads/favicon2.ico">
    <?php
    }
    }
    • This reply was modified 7 years, 1 month ago by Guenni007.
    #872567

    by the way here is a nice generator for all icons – favicon, apple-touch icon, etc:

    https://web-stuebchen.de/

    #872674

    Hi,

    Thanks for helping out @guenni007, did you try the suggestion above @loining?

    Best regards,
    Rikard

    #873585

    Thank you for good suggestions and solutions!
    I’m not used to work into function.php and not to sure is this will only make a change for the one sub-url and not interupt the rest of the site…???
    So a bit too worried to destroy my site to test it out yet.

    #873596

    LOGO
    Will if( is_single(‘4665’) in my case be [here with ‘ ‘ ]:
    if( is_single(‘http://nowguide.no/norjob/&#8217;) as this is the url that need logo2 ?

    Then for all other cases the logo at the child -> Theme Options will be used. Right?
    In my case http://nowguide.no/downloads/ms_2858.png

    FAVICON
    Will if( is_single(4665) in my case be [here without ‘ ‘ ]:
    if( is_single(http://nowguide.no/norjob/) as this is the url that needs another favicon? Here favicon1.

    But for all other url, favicon2 will be in use?
    Like in my case if( !is_single(http://nowguide.no/norjob/)

    Meaning NOT the http://nowguide.no/norjob/ USE favicon2… right?

    #873601

    can you please use for code the code element – it is better readable – and for you much more important it is copyable
    it works either by click once on code button above – insert the code – click on (now it is /code-tag) this button after it
    or insert the code – activate the whole block and click on code only once – than it will surrounds this lines.

    your link is postid-4665 and it is a single post – see source code
    For Logo change there is on enfold an option to do that by overwriting the other one but –

    i tested that if on enfold options dialog a favicon is set ! it could not be overwritten by this method – so there is the code for the first rule is to set favicon for that single post the other for not to be that single post

    the one is http://nowguide.no/downloads/ms_5564.png
    what is the other favicon ?

    you can see it here in action ( with is_page(330) – because it is in this case the page )
    https://webers-testseite.de/elegant/flexbox-model/

    all other pages got a different favicon.

    #873650
    #874294

    so try this in your functions.php of your child-theme:

    add_filter('avf_logo','av_change_logo_url');
    function av_change_logo_url($url)
    {
        if( is_single('4665') )
        {
            $url = "http://nowguide.no/wp-content/uploads/NorjobsideV2M-White.png";
        }
        return $url; 
    }
    
    add_action('wp_head', 'ava_add_iconnns');
    function ava_add_iconnns() {
    if( is_single(4665) ) {
    ?>
    	<link rel="shortcut icon" type="image/x-icon" href="http://nowguide.no/wp-content/uploads/cropped-NorjobFaviconM-White.png">
    <?php
    }
    if( !is_single(4665) ) {
    ?>
    	<link rel="shortcut icon" type="image/x-icon" href="http://nowguide.no/wp-content/uploads/NG-Favicon.png">
    <?php
    }
    }

    and do not enter on enfold options on favicon something. Let the option free

    #874860

    Hi,

    Thank you for pointing it out!

    Best regards,
    Basilis

    #877411

    2 weeks ago the question – ???
    ps : just think of clearing cache to see the results – you are using Lightspeed Caching tool

    #878220

    As you have given me all this help, I’m sorry there has been a slownes in my case. I bit because I’m afraid to to something bad to my website, and now when I had the currage I have been looking arround in cPanel to try to find the functions.php, but not able to locate it. I will Google it and see if youtube hold any Clue where to find it… My first time to enter this code..

    I did give it a try With the seach option and found a lot of functions.php
    One of then is located here: /nowguide.no/wp-admin/admin-functions.php, but not able to enter it.

    #878483

    The functions.php is a central part of every wordpress theme. And it is allmost in root directory of the theme.
    On Enfold it is supported through functions-enfold.php. – The child-theme functions.php only ( its possible to overwrite things in parent-theme but) complements ( adds, expanding ) some functions.

    so – are you using the enfold theme with a child-theme? That is important – and has a lot of advantages.
    https://kriesi.at/documentation/enfold/using-a-child-theme/

    the prebuild child-theme of enfold comes with an empty (only some comments are in it) functions.php .
    This is always the case if you find here some snippets to obtain some customisations.

    If you have installed a child-theme and activated it all benefits of the parent-theme are there but to bring some new code to it which does not go away on updates this functions.php is needed.
    You can than edit it via ftp or via dashboard – appearance – editor
    on the right side there are the (on start) two files in the child theme : style.css and functions.php
    the mentioned code above comes to this place!

    Feel free to ask if there is something you don’t understand

    #878878

    Hi,

    Well, event the Documentation of WordPress does not explain it that much!
    Thank you once again

    Best regards,
    Basilis

    #881703

    Hello,

    Thank you so much for your continued help!
    If I only knew it was that easy to get to the right code place… Thank you so much!
    Yes, I do use a child.

    When I’m logged in as an administrator, past in your code, and look up the http://nowguide.no/norjob/ web address, the Norjob logo is showing.
    But when I log out, it returns to just show the NowGuide logo also at http://nowguide.no/norjob/ or just norjob.no if you like.

    About the favicon, no success so far with anything.

    I give some settings in the pdf document linked to in the Dropbox link.
    https://www.dropbox.com/s/r27kw8k43jvvlgh/Norjob%20site.pdf?dl=0

    #881956

    Hi Loining,

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

    Best regards,
    Victoria

    #882167

    Thank you for taking the time for doing that!
    I will provide you with what you need.

    #882962

    Hi,

    The login credentials are not working. Please check it carefully. Did you adjust the page or post id value in the is_single function?

    Best regards,
    Ismael

    #882982

    Hello,
    I will provide you.
    As for an information, I have renamed the .htaccess file located at /wp-content/uploads
    This helped to activate the code in Nowguide: Theme Functions (functions.php)
    But not to get the right favicon, it now show one without white color inside the favicon.

    A negative side effect is that the menu went transparent.
    The very same problem THAT WAS at https://kriesi.at/support/topic/wrong-layout-of-main-meny/#post-882554

    #883051

    The .htaccess file located at /wp-content/uploads is now editet.
    The menu is back to normal.

    Now only the Favicon is the hard nut…

    #883054

    As an answer to your question:
    Did you adjust the page or post id value in the is_single function?

    No, I have not done anything to the is_single function other than the code applied;
    if( is_single(‘4665’) ) … for logo

    and if( is_single(4665) ) … for favicon

    Latest without ‘

    #883100

    Seems I was optimistic to fast.
    Back to not working

    #883474

    Well, the webhost has now checked it out, and by clicking litespeed plugin, ‘purge this site’ things start to work as it should :o)
    I think everything is solved now!

    #883475

    Except for the Favicon…
    are you able to log in now?

    #883508

    The favicon is still left on this post.
    New issues for that site is posted at:

    Thank you for the good support and help out so far!
    Especially a great thanks to you Guenni007!! Simply the best!

    #883756

    Hi,

    Continue here: https://kriesi.at/support/topic/change-of-header-only-for-one-sub-url/#post-883755

    We’ll close this thread now.

    Best regards,
    Ismael

Viewing 26 posts - 1 through 26 (of 26 total)
  • The topic ‘Two different logos and favicons’ is closed to new replies.