-
AuthorPosts
-
November 4, 2017 at 10:51 am #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!
November 4, 2017 at 6:02 pm #872563Edit 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 ago by Guenni007.
November 4, 2017 at 6:21 pm #872567by the way here is a nice generator for all icons – favicon, apple-touch icon, etc:
November 5, 2017 at 4:54 am #872674Hi,
Thanks for helping out @guenni007, did you try the suggestion above @loining?
Best regards,
RikardNovember 7, 2017 at 10:04 am #873585Thank 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.November 7, 2017 at 10:45 am #873596LOGO
Will if( is_single(‘4665’) in my case be [here with ‘ ‘ ]:
if( is_single(‘http://nowguide.no/norjob/’) 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.pngFAVICON
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?
November 7, 2017 at 10:57 am #873601can 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 postthe 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.
November 7, 2017 at 1:17 pm #873650Favicon:
OLD
http://nowguide.no/downloads/ms_5564.png
http://nowguide.no/wp-content/uploads/NG-Favicon.pngNEW
http://nowguide.no/wp-content/uploads/cropped-NorjobFaviconM-White.pngLogo:
OLD
http://nowguide.no/downloads/ms_2858.png
http://nowguide.no/wp-content/uploads/2015/06/LogoNowguide.pngNEW
http://nowguide.no/wp-content/uploads/NorjobsideV2M-White.pngNovember 8, 2017 at 7:30 pm #874294so 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
November 9, 2017 at 10:52 pm #874860Hi,
Thank you for pointing it out!
Best regards,
BasilisNovember 16, 2017 at 9:08 am #8774112 weeks ago the question – ???
ps : just think of clearing cache to see the results – you are using Lightspeed Caching toolNovember 17, 2017 at 5:58 pm #878220As 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.November 18, 2017 at 11:18 am #878483The 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
November 19, 2017 at 10:25 pm #878878Hi,
Well, event the Documentation of WordPress does not explain it that much!
Thank you once againBest regards,
BasilisNovember 25, 2017 at 7:17 pm #881703Hello,
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=0November 26, 2017 at 6:30 pm #881956Hi 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,
VictoriaNovember 27, 2017 at 11:40 am #882167Thank you for taking the time for doing that!
I will provide you with what you need.November 29, 2017 at 8:15 am #882962Hi,
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,
IsmaelNovember 29, 2017 at 11:14 am #882982Hello,
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-882554November 29, 2017 at 2:24 pm #883051The .htaccess file located at /wp-content/uploads is now editet.
The menu is back to normal.Now only the Favicon is the hard nut…
November 29, 2017 at 2:31 pm #883054As 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 logoand if( is_single(4665) ) … for favicon
Latest without ‘
November 29, 2017 at 4:41 pm #883100Seems I was optimistic to fast.
Back to not workingNovember 30, 2017 at 3:45 pm #883474Well, 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!November 30, 2017 at 3:46 pm #883475Except for the Favicon…
are you able to log in now?November 30, 2017 at 5:20 pm #883508The 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!December 1, 2017 at 8:07 am #883756Hi,
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 -
AuthorPosts
- The topic ‘Two different logos and favicons’ is closed to new replies.