-
AuthorPosts
-
January 7, 2018 at 4:26 pm #894366
Hi Guys
I want to create a quick function on the enfold theme functions file of my child theme. I am hoping to update the default wordpress logo seen on the login page with the theme logo that is set in the enfold theme settings.
Is their a function I can use to get the logo url set in the enfold theme settings?
January 7, 2018 at 8:42 pm #894473Hey codecreative,
I’m not sure I understand. You can change the logo in theme options. No need for the code in functions.php. Can you elaborate a bit more?
Best regards,
VictoriaJanuary 7, 2018 at 11:15 pm #894530Sure no problem
When you go to your domain.com/wp-admin
You see a login page asking for username and password. Above this is a default w logo for WordPress. I see many people change that logo it’s easy to do.
What I want is to get the url for the current logo that has been set in the enfold theme settings. Is there a function to get that url?
I can then use a filter to apply that to over ride the logo seen on login page. The benefit of this is that if someone updates the logo in the themes settings once it also automatically updates it on the login page.
January 8, 2018 at 12:40 am #894540Hi,
https://codex.wordpress.org/Customizing_the_Login_Form
You can use the filter and get the option from the theme options applied there.
You can check the header.php how to call the proper logo.let us know if anything else is needed.
Best regards,
BasilisJanuary 14, 2018 at 12:02 pm #897056I almost have it working now. For some reason the css is being applied but I can’t see the logo
My php is
/* To set the admin login image */
function my_login_logo() {
$logo = avia_get_option(‘logo’); ?>
<style type=”text/css”>
#login h1 a, .login h1 a {
background-image: url(<?php echo $logo; ?>);
height:auto;
width:auto;
background-size: inherit;
background-repeat: no-repeat;
padding-bottom: 30px;
}
</style>
<?php }
add_action( ‘login_enqueue_scripts’, ‘my_login_logo’ );- This reply was modified 6 years, 11 months ago by codecreative.
January 14, 2018 at 12:17 pm #897058Hi
I would like to say the above function works fine
The issue I had was the logo I was uploading was far too large to be visible!
Is there a way to get the dimensions of the logo so the logo a area can be set to fit the size? or too possibly use medium attachment size?
- This reply was modified 6 years, 11 months ago by codecreative.
January 15, 2018 at 2:13 am #897293 -
AuthorPosts
- You must be logged in to reply to this topic.