{"id":9659,"date":"2024-07-05T11:31:00","date_gmt":"2024-07-05T11:31:00","guid":{"rendered":"https:\/\/musilda.cz\/?p=9659"},"modified":"2024-07-05T11:31:00","modified_gmt":"2024-07-05T11:31:00","slug":"jak-zmenit-vzhled-prihlasovaci-stranky-wordpressu","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-zmenit-vzhled-prihlasovaci-stranky-wordpressu\/","title":{"rendered":"Jak zm\u011bnit vzhled p\u0159ihla\u0161ovac\u00ed str\u00e1nky WordPressu"},"content":{"rendered":"\n
Nel\u00edb\u00ed se v\u00e1m design p\u0159ihla\u0161ovac\u00ed str\u00e1nky WordPressu? \u00daprava vzhledu je jednodu\u0161\u0161\u00ed, ne\u017e si mysl\u00edte. P\u0159izp\u016fsoben\u00edm p\u0159ihla\u0161ovac\u00edho formul\u00e1\u0159e v\u00e1m umo\u017en\u00ed vytvo\u0159it str\u00e1nku, kter\u00e1 odpov\u00edd\u00e1 designu va\u0161eho webu, tak\u017ee p\u016fsob\u00ed vizu\u00e1ln\u011b atraktivn\u011bji a profesion\u00e1ln\u011bji.<\/p>\n\n\n\n
Defaultn\u00ed vzhled p\u0159ihla\u0161ovac\u00edho formul\u00e1\u0159e WordPressu vypad\u00e1 n\u00e1sledovn\u011b:<\/p>\n\n\n\n V dne\u0161n\u00edm \u010dl\u00e1nku si uvedeme dva zp\u016fsoby, pomoc\u00ed kter\u00fdch lze po\u017eadovan\u00fdch zm\u011bn dos\u00e1hnout:<\/p>\n\n\n\n Zam\u011b\u0159\u00edme se na plugin „Custom Login Page Customizer<\/a><\/strong>„, d\u00edky kter\u00e9mu dok\u00e1\u017eete vzhled p\u0159ihla\u0161ovac\u00ed str\u00e1nky kompletn\u011b zm\u011bnit pomoc\u00ed n\u011bkolika kliknut\u00ed. Konkr\u00e9tn\u011b m\u016f\u017eete editovat pozad\u00ed p\u0159ihla\u0161ovac\u00ed str\u00e1nky, barvy, fonty a p\u0159idat vlastn\u00ed loga, nebo obr\u00e1zky.<\/p>\n\n\n\n Po aktivaci se v administraci WordPressu objev\u00ed nov\u00e1 kolonka s n\u00e1zvem Login Customizer<\/strong>, ve kter\u00e9 najdete Setting <\/strong>a Customizer<\/strong>:<\/p>\n\n\n\n Po nastaven\u00ed p\u0159ejdeme do Customizeru, kter\u00fd n\u00e1m umo\u017en\u00ed editovat vzhled str\u00e1nky ve frontendu.<\/p>\n\n\n\n Jednotliv\u00e1 nastaven\u00ed customizeru si zde vysv\u011btl\u00edme:<\/p>\n\n\n\n V\u00fdsledek pr\u00e1ce pak m\u016f\u017ee vypadat nap\u0159\u00edklad n\u011bjak takto:<\/p>\n\n\n\n O n\u011bco slo\u017eit\u011bj\u0161\u00ed zp\u016fsob, kter\u00fd je vhodn\u00fd zejm\u00e9na pro ty, kte\u0159\u00ed necht\u011bj\u00ed zat\u011b\u017eovat web spoustou jednor\u00e1zov\u00fdch plugin\u016f.<\/p>\n\n\n\n Ne\u017e budete pokra\u010dovat, ujist\u011bte se, \u017ee pou\u017e\u00edv\u00e1te child theme<\/strong><\/a>, jinak by se po aktualizaci \u0161ablony ve\u0161ker\u00e9 zm\u011bny p\u0159epsaly!!<\/p>\n\n\n\n K\u00f3d v\u017edy vkl\u00e1dejte na konec souboru functions.php<\/strong> va\u0161\u00ed \u0161ablony (k souboru se dostanete p\u0159es Vzhled > Editor souboru \u0161ablony<\/strong>).<\/p>\n\n\n\n Nejprve si uk\u00e1\u017eeme n\u011bkter\u00e9 zm\u011bny, kter\u00e9 lze prov\u00e9zt pouze pomoc\u00ed php funkc\u00ed, a v dal\u0161\u00ed sekci si zalo\u017e\u00edme nov\u00fd CSS soubor pro \u00fapravu vzhledu.<\/p>\n\n\n\n V tomto p\u0159\u00edpad\u011b p\u0159esm\u011brujeme u\u017eivatele na domovskou str\u00e1nku webu:<\/p>\n\n\n\n Automatick\u00fdm za\u0161krtnut\u00edm pole „Pamatovat si m\u011b“ se sn\u00ed\u017e\u00ed po\u010det u\u017eivatel\u016f, kte\u0159\u00ed pole neza\u0161krtli a r\u00e1zem ztratili, nebo zapomn\u011bli sv\u00e9 p\u0159ihla\u0161ovac\u00ed \u00fadaje na web.<\/p>\n\n\n\n Pokud se chyst\u00e1te prov\u00e1d\u011bt rozs\u00e1hlej\u0161\u00ed \u00fapravy t\u00fdkaj\u00edc\u00edch se vzhledu, bude pot\u0159eba vytvo\u0159it vlastn\u00ed CSS soubor, do kter\u00e9ho budete v\u0161echny zm\u011bny vzhledu p\u0159ihla\u0161ovac\u00ed str\u00e1nky ukl\u00e1dat:<\/p>\n\n\n\n<\/a><\/figure>\n\n\n\n
\n
Zm\u011bna vzhledu pomoc\u00ed pluginu<\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Setting – Nastaven\u00ed<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Customizer – P\u0159izp\u016fsoben\u00ed vzhledu<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Templates – p\u0159edem definovan\u00e9 \u0161ablony<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Background – zm\u011bna pozad\u00ed<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Logo<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Form – vzhled formul\u00e1\u0159e<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Fields – vzhled pol\u00ed formul\u00e1\u0159e<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Button – vzhled tla\u010d\u00edtko<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Other – ostatn\u00ed<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
Custom CSS & Javascript<\/h4>\n\n\n\n
<\/a><\/figure>\n\n\n\n
\n
<\/a><\/figure>\n\n\n\n
Zm\u011bna funkc\u00ed pomoc\u00ed PHP<\/h2>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Zm\u011bna URL pro p\u0159esm\u011brov\u00e1n\u00ed u\u017eivatel\u016f, kte\u0159\u00ed se p\u0159ihl\u00e1sili<\/h3>\n\n\n\n
function admin_login_redirect( $redirect_to, $request, $user ) {\n global $user;\n\n if( isset( $user->roles ) && is_array( $user->roles ) ) {\n if( in_array( \"administrator\", $user->roles ) ) {\n return $redirect_to;\n }\n else {\n return home_url();\n }\n }\n else {\n return $redirect_to;\n }\n}\n\nadd_filter(\"login_redirect\", \"admin_login_redirect\", 10, 3);<\/code><\/pre>\n\n\n\n
Automatick\u00e9 za\u0161krtnut\u00ed pole pamatovat si m\u011b<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n
function login_checked_remember_me() {\nadd_filter( 'login_footer', 'rememberme_checked' );\n}\nadd_action( 'init', 'login_checked_remember_me' );\n\nfunction rememberme_checked() {\necho \"<script>document.getElementById('rememberme').checked = true;<\/script>\";\n}<\/code><\/pre>\n\n\n\n
Zm\u011bna vzhledu pomoc\u00ed CSS<\/h2>\n\n\n\n
\n
function my_custom_login_stylesheet() {\n wp_enqueue_style('custom-login', get_stylesheet_directory_uri() . '\/login-style.css');\n}\nadd_action('login_enqueue_scripts', 'my_custom_login_stylesheet');<\/code><\/pre>\n\n\n\n