{"id":3070,"date":"2025-09-22T16:37:34","date_gmt":"2025-09-22T16:37:34","guid":{"rendered":"https:\/\/codingfix.com\/?p=3070"},"modified":"2025-10-25T11:23:12","modified_gmt":"2025-10-25T11:23:12","slug":"custom-login-logo","status":"publish","type":"post","link":"https:\/\/codingfix.com\/custom-login-logo\/","title":{"rendered":"Custom login logo"},"content":{"rendered":"\n<div class=\"wp-block-greenshift-blocks-row gspb_row gspb_row-id-gsbp-38d0038\" id=\"gspb_row-id-gsbp-38d0038\"><div class=\"gspb_row__content\"> \n<div class=\"wp-block-greenshift-blocks-row-column gspb_row__col--12 gspb_col-id-gsbp-eac17c2\" id=\"gspb_col-id-gsbp-eac17c2\">\n<h2 id=\"gspb_heading-id-gsbp-5e8aded\" class=\"gspb_heading gspb_heading-id-gsbp-5e8aded \">Custom login logo<\/h2>\n\n\n\n<div id=\"gspb_text-id-gsbp-a2e0f0a\" class=\"gspb_text gspb_text-id-gsbp-a2e0f0a \">In the functions.php file add these lines:<br><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>&lt;?php\nfunction custom_login_logo() {\n    echo '&lt;style type=\"text\/css\">\n        h1 a { background-image: url(' . get_stylesheet_directory_uri() . '\/images\/logo.png) !important; \n        }\n} &lt;\/style>';\nadd_action('login_head', 'custom_login_logo');<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #000000\">&lt;?php<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">function<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">custom_login_logo<\/span><span style=\"color: #000000\">() {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #795E26\">echo<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;&lt;style type=&quot;text\/css&quot;&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A31515\">        h1 a { background-image: url(&#39;<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">get_stylesheet_directory_uri<\/span><span style=\"color: #000000\">() <\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #A31515\">&#39;\/images\/logo.png) !important; <\/span><\/span>\n<span class=\"line\"><span style=\"color: #A31515\">        }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A31515\">} &lt;\/style&gt;&#39;<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #795E26\">add_action<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&#39;login_head&#39;<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #A31515\">&#39;custom_login_logo&#39;<\/span><span style=\"color: #000000\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div id=\"gspb_text-id-gsbp-b20d49b\" class=\"gspb_text gspb_text-id-gsbp-b20d49b \"><br><em><em><em><em>Brand your login like a boss. Your site, your rules. \ud83d\ude0e<\/em><\/em><\/em><\/em><\/div>\n<\/div>\n <\/div><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":3051,"comment_status":"open","ping_status":"open","sticky":false,"template":"wp-custom-template-single-ninja-post","format":"standard","meta":{"_gspb_post_css":"#gspb_row-id-gsbp-38d0038{justify-content:space-between;margin-top:0;display:flex;flex-wrap:wrap;margin-bottom:0}#gspb_row-id-gsbp-38d0038>.gspb_row__content{display:flex;justify-content:space-between;margin:0 auto;width:100%;flex-wrap:wrap}.gspb_row{position:relative}div[id^=gspb_col-id]{box-sizing:border-box;position:relative;padding:var(--gs-row-column-padding, 15px min(3vw, 20px))}body.gspb-bodyfront #gspb_row-id-gsbp-38d0038>.gspb_row__content{max-width:var(--wp--style--global--wide-size, 1200px)}#gspb_col-id-gsbp-eac17c2.gspb_row__col--12{width:100%}@media (max-width:575.98px){#gspb_col-id-gsbp-eac17c2.gspb_row__col--12{width:100%}}.gspb_text-id-gsbp-b20d49b{margin-bottom:0!important}","footnotes":""},"categories":[134],"tags":[],"post_folder":[144],"class_list":["post-3070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wp-sniptips"],"_links":{"self":[{"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/posts\/3070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/comments?post=3070"}],"version-history":[{"count":3,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/posts\/3070\/revisions"}],"predecessor-version":[{"id":3177,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/posts\/3070\/revisions\/3177"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/media\/3051"}],"wp:attachment":[{"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/media?parent=3070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/categories?post=3070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/tags?post=3070"},{"taxonomy":"post_folder","embeddable":true,"href":"https:\/\/codingfix.com\/wp-json\/wp\/v2\/post_folder?post=3070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}