Home › Forums › Basel support forum › SVG Logo Image
SVG Logo Image
- This topic has 20 replies, 2 voices, and was last updated 8 years, 3 months ago by Artem Temos.
-
AuthorPosts
-
August 12, 2016 at 7:26 am #2670
jackbanisterParticipantHi there,
Is there a way I can use a SVG image as the logo? Say if I uploaded an svg to the cPanel file manager and pasted the link in the theme options somehow?
Any help would be greatly appreciated.
Many thanks,
JackAugust 12, 2016 at 7:32 am #2671
Artem TemosKeymasterHello,
Thank you for contacting us.
The easiest way for you will be:
1. Upload your SVG logo to the server
2. Set up basel child theme
3. Override logo PHP function to get logo not from Theme Settings but set your path manually. Here is the code that you need to place into functions.php file in the child theme
function basel_get_logo() { $logo_src = 'http://YOURWEB_SITE/LOGO_IMAGE.svg' ?> <a href="<?php echo esc_url( home_url('/') ); ?>" rel="home"><img src="<?php echo esc_url( $logo_src ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"></a> <?php }
Don’t forget to set your actual path to the image.
Regards
August 12, 2016 at 7:41 am #2672
jackbanisterParticipantHi, thanks for the prompt reply.
How do I upload the svg file to the server? Do I just upload it into the theme basel child file in the cPanel ?
August 12, 2016 at 8:05 am #2673
Artem TemosKeymasterYes, you can just upload your logo image through the cPanel.
August 12, 2016 at 8:14 am #2674
jackbanisterParticipantok, do I upload it to the child theme or the main theme?
August 12, 2016 at 8:19 am #2675
jackbanisterParticipantSo I go to the website public html, then wp-content, then upload to the theme?
August 12, 2016 at 10:06 am #2678
jackbanisterParticipantAlso, I was already running the Basel Child theme.
I just changed the functions php in the basel child theme folder (in the cPanel file manager section) like you said so it’d include the svg file link (http://sarakirkbyinteriors.com/wp-content/themes/basel/images/SaraKLogo4.svg) – I uploaded this to the images section of the Basel theme (not the child theme).
Should I be doing something else to override the current logo? And should I reload the child theme or will it already take into account I’ve updated the functions php?
Many thanks,
JackAugust 12, 2016 at 7:07 pm #2688
Artem TemosKeymasterFirst: upload your logo not to basel folder but to child theme folder (basel-child/images/your-logo.svg)
After uploading and activating your child theme you will have the file
wp-content/themes/basel-child/functions.php
. So please add the code to this file and save it.August 12, 2016 at 7:43 pm #2693
jackbanisterParticipantAfraid it still doesn’t work. I was already running the child theme – should I reinstall it? And will it mess up my site progress if I reinstall?
August 12, 2016 at 7:58 pm #2694
Artem TemosKeymasterPlease, provide your FTP access we will try to do it faster 🙂
August 12, 2016 at 8:02 pm #2695
jackbanisterParticipantSorry, how do I do that?
August 12, 2016 at 8:03 pm #2696
Artem TemosKeymasterDo you have FTP access so wee could connect your server and edit your files?
August 12, 2016 at 8:04 pm #2697
jackbanisterParticipantI’m not sure if I have FTP access. How do I find out?
August 12, 2016 at 8:05 pm #2698
Artem TemosKeymasterAnd also try to place this code to the functions.php file instead of previous one
function basel_header_block_logo() { $logo_src = 'http://YOURWEB_SITE/LOGO_IMAGE.svg' $logo_img = '<img src="' . $logo_src . '" alt="' . get_bloginfo( 'name' ) . '" />' ?> <div class="site-logo"> <a href="<?php echo esc_url( home_url('/') ); ?>" rel="home"> <?php echo ( $logo_img ); ?> </a> </div> <?php }
August 12, 2016 at 8:13 pm #2699
jackbanisterParticipanttried that, it’s come up with this-
Parse error: syntax error, unexpected ‘$logo_img’ (T_VARIABLE) in /home1/jackbanister/public_html/sarakirkbyinteriors.com/wp-content/themes/basel-child/functions.php on line 17
August 12, 2016 at 8:14 pm #2700
Artem TemosKeymasterIn this case the only one way to help you is to edit functions.php file by ourselves. Could you please provide your FTP account or cPanel access?
August 12, 2016 at 8:16 pm #2701
Artem TemosKeymasterSorry again. Try to change code with the following 🙂
function basel_header_block_logo() { $logo_src = 'http://YOURWEB_SITE/LOGO_IMAGE.svg'; $logo_img = '<img src="' . $logo_src . '" alt="' . get_bloginfo( 'name' ) . '" />' ?> <div class="site-logo"> <a href="<?php echo esc_url( home_url('/') ); ?>" rel="home"> <?php echo ( $logo_img ); ?> </a> </div> <?php }
August 12, 2016 at 8:20 pm #2702
jackbanisterParticipantYes, it worked! Thanks so much!
… Now can I adjust its size?
August 12, 2016 at 8:25 pm #2703
jackbanisterParticipantNot to worry, just found it in the theme options section!
Thanks again for being so helpful!
August 12, 2016 at 9:06 pm #2705
jackbanisterParticipantok, sorry I’m back to ask something else to do with the logo.
How do I change the white logo on the footer..
August 13, 2016 at 8:24 am #2710
Artem TemosKeymasterYou can change your footer logo image in Appearance -> Widgets.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register