-
AuthorPosts
-
April 10, 2021 at 4:13 pm #1293646
Hello,
I have a white logo and menu on my front page and that works fine.
On my other pages I have a white backround and you cant see the logo and the menu, I would like to have a black logo and menu on the other pages. Is there an option ?Thanks
April 10, 2021 at 6:13 pm #1293668Hey henninglehmkuhle,
Do you have a black version of the logo? Using css to default text to black except for the homepage, this may be possible.
Best regards,
Jordan ShannonApril 10, 2021 at 6:33 pm #1293682Thanks for the fast answer !
Yes I do.
Okay, and how does that work ? Sorry, pretty new to enfold
April 10, 2021 at 7:29 pm #1293693you can do it over the same filter in different ways ( one over url – the other over logo )
As Jordan said – set the one logo you like to have on all pages except few other pages to the enfold options dialog.
then put this in child-theme functions.php:
function replace_logo_on_some_pages($logo){ if(is_page(array( 'home', 1396, 1234, ))){ $logo = "/wp-content/uploads/alternativ-logo.png"; } return $logo; } add_filter('avf_logo','replace_logo_on_some_pages');
or as mentioned above: via url:
function av_change_logo_url($url){ if(is_page(array( 'home', 1396, 1234, ))){ $url = "/wp-content/uploads/alternate-logo.jpg"; } return $url; } add_filter('avf_logo','av_change_logo_url');
the numbers are the page-ids – page names comes into quotation marks.
if it is only the home or front_page or a single page replace that line with the array by
if(is_front_page()){ or if(is_home()){ or if(is_page( 1234 )) {
April 10, 2021 at 9:38 pm #1293700es ist sehr zu empfehlen, ein Child-theme zu nutzen. Das ist kein Zauberwerk und recht schnell eingerichtet. Es gibt auch ein vorgefertigtes Child-Theme in der Dokumentation zum download.: https://kriesi.at/documentation/enfold/child-theme/
Alle kleinen nützlichen Tips die über die functions.php laufen sind so recht simple anzuwenden, und gehen auch in der Regel nicht bei einem Update des Eltern-Themas verloren.
Gerade am Anfang einer Installation ist dies sehr simple zu machen. Sollte ein Thema schon recht fortgeschritten installiert sein bietet Enfold auch hier durch Übernahme der Einstellungen gute Möglichkeiten auch nachträglich noch umzustellen.April 11, 2021 at 2:29 pm #1293769Mhmm, it’s not working.
Im trying it with this code :
function replace_logo_on_some_pages($logo){
if(is_page( 3386 )) {
$logo = “/wp-content/uploads/2021/04/Element-1-4-1030×167.png“;
}
return $logo;
}
add_filter(‘avf_logo’,’replace_logo_on_some_pages’);But the logo stays black on the front page..
April 12, 2021 at 12:31 am #1293810and your front-page realy get that high ID ( 3386 ) ?
and your front-page is a page? it might be a post?
and the link to your alternative Logo – try the absolute path with https://domain/wp-content/ …etcbest would be to have a live link for me to give better advice – if you like write me an email.
function replace_logo_on_some_pages($logo){ if(is_home()){ $logo = "/wp-content/uploads/2021/04/Element-1-4-1030×167.png"; } return $logo; } add_filter('avf_logo','replace_logo_on_some_pages');
PS : i see now the dimensions of your “logo” – is it set as background ? and not in Enfold Options Dialog : “Logo” ?
-
AuthorPosts
- You must be logged in to reply to this topic.