{"id":698,"date":"2013-06-26T18:08:45","date_gmt":"2013-06-26T18:08:45","guid":{"rendered":"http:\/\/musilda.cz\/?p=698"},"modified":"2013-06-26T18:08:45","modified_gmt":"2013-06-26T18:08:45","slug":"jak-vlozit-fotografii-do-profilu-uzivatele-ve-wordpress","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-vlozit-fotografii-do-profilu-uzivatele-ve-wordpress\/","title":{"rendered":"Jak vlo\u017eit fotografii do profilu u\u017eivatele ve WordPress"},"content":{"rendered":"
K dne\u0161n\u00edmu \u010dl\u00e1nku mne inspiroval koment\u00e1\u0159, kter\u00fd se zde ned\u00e1vno objevil. Proto\u017ee jsem v tu chv\u00edli nem\u011bl \u010das vym\u00fd\u0161let \u0159e\u0161en\u00ed, jak do profilu u\u017eivatele p\u0159idat mo\u017enost vlo\u017eit fotografii, doporu\u010dil jsem plugin. Vzhledem k tomu, \u017ee nejsem p\u0159\u00edznivcem bezhlav\u00e9ho pou\u017e\u00edv\u00e1n\u00ed plugin\u016f, uk\u00e1\u017ei v\u00e1m v tomto n\u00e1vodu, jak vlo\u017eit do profilu pole pro url adresu fotografie u\u017eivatele.\u00a0<\/p>\n
Prvn\u00ed v\u011bc, kterou mus\u00edme ud\u011blat, je nahr\u00e1t fotografii na web a zn\u00e1t jej\u00ed url. Pokud budete nahr\u00e1vat fotografii v\u011bt\u0161\u00ed, ne\u017e je velikost, v kter\u00e9 se bude zobrazovat, nezapome\u0148te ji pomoc\u00ed styl\u016f zmen\u0161it. Nyn\u00ed ji\u017e k samotn\u00e9 \u00faprav\u011b.<\/p>\n
Otev\u0159eme si soubor functions.php a do n\u011bj vlo\u017e\u00edme n\u00e1sleduj\u00edc\u00ed k\u00f3d:<\/p>\n
\nadd_action( 'show_user_profile', 'my_photo_fields' );\nadd_action( 'edit_user_profile', 'my_photo_fields' );\n\nfunction my_photo_fields( $user ) { ?>\n