-
AuthorPosts
-
March 11, 2022 at 11:14 am #1344121
Hi I need to build an header like this, with 3 logos:
1) the main on the left
2) e 3) on the right (they need to be clickable).Like this.
I followed this guide with no success (chapter “Add multiple logos”), put this code in my child functions.php:
------------------------------- Remove the logo ------------------------------- add_filter('avf_logo_final_output', 'avia_remove_default_logo', 10, 6); function avia_remove_default_logo($logo, $use_image, $headline_type, $sub, $alt, $link){ return ''; } ------------------------------- Additional Logos ------------------------------- function add_logos($logo) { if(is_page(home)){ $logo .= '<a class="first-logo" href="/"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/logo-rivista.jpg"/></a>'; $logo .= '<a class="second-logo" href="https://toscanamedica.org"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/logo-ordine.jpg"/></a>'; $logo .= '<a class="third-logo" href="https://www.pacinimedicina.it"><img src="http://rivista-toscana-medica.local/wp-content/uploads/2022/03/pacinimedicina.png"/></a>'; } return $logo; } add_filter('avf_logo_final_output', 'add_logos');
But having this php error:
(! ) FATAL ERROR: UNCAUGHT ERROR: UNDEFINED CONSTANT “HOME” IN /USERS/NIGULI/LOCAL SITES/RIVISTA-TOSCANA-MEDICA/APP/PUBLIC/WP-CONTENT/THEMES/ENFOLD-CHILD/FUNCTIONS.PHP ON LINE 21
What am I doing wrong?
Line 21 is:
if(is_page(home)){
So does the code not recognize which is the homepage? why? Thanks for helping me.
March 12, 2022 at 1:33 pm #1344210hi, any help from someone?
March 12, 2022 at 2:01 pm #1344214Hi,
Thanks for your patience, you need to use eitherif ( is_home() ) {
orif ( is_front_page() ) {
I believe is_front_page() is the correct one.Best regards,
MikeMarch 13, 2022 at 3:11 pm #1344280if ( is_front_page() ) {
worked for me. Thanks Mike, very precious.
UPDATE: I need the 3 logos in all pages. Now I’m having them only on the front page.
Can you help me to modify the php function?- This reply was modified 2 years, 8 months ago by niguli.
March 13, 2022 at 3:21 pm #1344282Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘3 logos’ is closed to new replies.