{"id":1911,"date":"2014-08-17T10:44:17","date_gmt":"2014-08-17T10:44:17","guid":{"rendered":"http:\/\/musilda.cz\/?p=1911"},"modified":"2014-08-17T10:44:17","modified_gmt":"2014-08-17T10:44:17","slug":"jak-vytvorit-vlastni-sablonu-pro-wordpress-6-dil","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-vytvorit-vlastni-sablonu-pro-wordpress-6-dil\/","title":{"rendered":"Jak vytvo\u0159it vlastn\u00ed \u0161ablonu pro WordPress – 6 d\u00edl"},"content":{"rendered":"\n
V\u00edt\u00e1m v\u00e1s ji\u017e u \u0161est\u00e9ho d\u00edlu seri\u00e1lu Jak vytvo\u0159it vlastn\u00ed \u0161ablonu pro WordPress<\/strong>. V minul\u00e9m d\u00edle jsme si vytvo\u0159ili dv\u011b \u0161ablony str\u00e1nek, upravili jsme css t\u0159\u00eddy pro nov\u011bj\u0161\u00ed verzi Bootstrapu a p\u0159idali trochu styl\u016f.<\/p>\n\n\n\n Dnes se budeme v\u011bnovat zobrazen\u00ed metadat u v\u00fdpisu \u010dl\u00e1nk\u016f a zobrazen\u00ed koment\u00e1\u0159\u016f.<\/p>\n\n\n\n Nejsem si jist, zda se jedn\u00e1 o ofici\u00e1ln\u00ed n\u00e1zev, ale v \u0161ablon\u011b jsou v\u011bt\u0161inou tyto informace takto nazv\u00e1ny a jedn\u00e1 se o data, kter\u00e1 jsou n\u011bjak\u00fdm zp\u016fsobem spojena s \u010dl\u00e1nkem.<\/p>\n\n\n\n Nap\u0159\u00edklad:<\/p>\n\n\n\n V tuto chv\u00edli se n\u00e1\u0161 v\u00fdpis \u010dl\u00e1nk\u016f zobrazuje takto:<\/p>\n\n\n\n A pr\u00e1v\u011b mezi titulek a zkr\u00e1cen\u00fd v\u00fdpis vlo\u017e\u00edme tato metadata.<\/p>\n\n\n\n Otev\u0159eme si soubor content.php a do n\u011bj vlo\u017e\u00edme nov\u00fd div p\u0159\u00edmo za h2:<\/p>\n\n\n\n Pro zobrazen\u00ed jm\u00e9na autora \u010dl\u00e1nku pou\u017eijeme funkci the_author_posts_link(), jen\u017e n\u00e1m zobraz\u00ed jm\u00e9no autora, spole\u010dn\u011b s odkazem na v\u00fdpis jeho dal\u0161\u00ed \u010dl\u00e1nky. Div uprav\u00edme:<\/p>\n\n\n\n A proto\u017ee jsme pou\u017eili Bootstrap, kter\u00fd m\u00e1 celkem dost komponent, m\u016f\u017eeme jednodu\u0161e p\u0159ed autora vlo\u017eit ikonku:<\/p>\n\n\n\n V tuto chv\u00edli vypad\u00e1 v\u00fdpis takto:<\/p>\n\n\nCo jsou post meta?<\/h2>\n\n\n\n
\n
\n
<!-- Post meta -->\n<div class=\"entry-meta\">\n<\/div><\/code><\/pre>\n\n\n\n
Autor \u010dl\u00e1nku<\/h2>\n\n\n\n
<!-- Post meta -->\n <div class=\"entry-meta\">\n <span class=\"entry-author\">\n <?php the_author_posts_link(); ?>\n <\/span>\n <\/div><\/code><\/pre>\n\n\n\n
<!-- Post meta -->\n <div class=\"entry-meta\">\n <span class=\"entry-author\">\n <span class=\"glyphicon glyphicon-user\"><\/span>\n <?php the_author_posts_link(); ?>\n <\/span>\n <\/div><\/code><\/pre>\n\n\n\n