{"id":9811,"date":"2013-04-27T07:16:56","date_gmt":"2013-04-27T07:16:56","guid":{"rendered":"http:\/\/musilda.cz\/?p=222"},"modified":"2013-04-27T07:16:56","modified_gmt":"2013-04-27T07:16:56","slug":"zakladni-css-styly-generovane-wordpressem","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/zakladni-css-styly-generovane-wordpressem\/","title":{"rendered":"Z\u00e1kladn\u00ed css styly generovan\u00e9 WordPressem"},"content":{"rendered":"
S t\u00edm jak p\u0159ipravuji \u0159adu \u010dl\u00e1nk\u016f s n\u00e1vodem pro vytvo\u0159en\u00ed responsivn\u00ed \u0161ablony pro WordPress, objevila se ot\u00e1zka, kter\u00e9 css t\u0159\u00eddy budou nutn\u00e9 pro jednoduchou \u0161ablonu a jen\u017e WordPress generuje. Hledal jsem tedy seznam v\u0161ech t\u0159\u00edd, kter\u00e9 by v souboru se styly m\u011bli b\u00fdt a nakonec jsem spojil podklady z \u010dl\u00e1nku na wpbeginner a z codexu.<\/p>\n
T\u00e9m\u011b\u0159 v\u0161echny prvky ve WordPressu si m\u016f\u017eete upravit a p\u0159idat jim vlastn\u00ed t\u0159\u00eddy, kter\u00e9 v\u00e1m umo\u017en\u00ed nastylovat vlastn\u00ed vzhled, tak jak pot\u0159ebujete. Syst\u00e9m tak\u00e9 generuje t\u0159\u00eddy ji\u017e v z\u00e1kladn\u00edm nastaven\u00ed a jejich znalost v\u00e1m vytv\u00e1\u0159en\u00ed \u0161ablon uleh\u010d\u00ed.<\/p>\n
Body je p\u0159\u00edtomen na ka\u017ed\u00e9 str\u00e1nce, kterou zobraz\u00edte a dle toho, kde se nach\u00e1z\u00edte, zobrazuj\u00ed se v n\u011bm r\u016fzn\u00e9 t\u0159\u00eddy. Aby se v tagu zobrazovaly generovan\u00e9 t\u0159\u00eddy, m\u011blo by body obsahovat funkci body_class();.<\/p>\n
Seznam css t\u0159\u00edd:<\/p>\n
.rtl {}\n.home {}\n.blog {}\n.archive {}\n.date {}\n.search {}\n.paged {}\n.attachment {}\n.error404 {}\n.single postid-(id) {}\n.attachmentid-(id) {}\n.attachment-(mime-type) {}\n.author {}\n.author-(user_nicename) {}\n.category {}\n.category-(slug) {}\n.tag {}\n.tag-(slug) {}\n.page-parent {}\n.page-child parent-pageid-(id) {}\n.page-template page-template-(template file name) {}\n.search-results {}\n.search-no-results {}\n.logged-in {}\n.paged-(page number) {}\n.single-paged-(page number) {}\n.page-paged-(page number) {}\n.category-paged-(page number) {}\n.tag-paged-(page number) {}\n.date-paged-(page number) {}\n.author-paged-(page number) {}\n.search-paged-(page number) {}<\/pre>\nPokud v\u00e1m m\u011bn\u00edc\u00ed se t\u0159\u00eddy nevyhovuj\u00ed, sta\u010d\u00ed p\u0159idat do body_class(‚moje-trida‘).<\/p>\n
T\u0159\u00eddy pro post<\/h2>\n
Stejn\u011b jako body i post m\u00e1 t\u0159\u00eddy p\u0159i pou\u017eit\u00ed post_class(). Pou\u017eit\u00ed stejn\u00e9 jako u body_class.<\/p>\n
Seznam t\u0159\u00edd:<\/p>\n
.post-id {}\n.post {}\n.page {}\n.attachment {}\n.sticky {}\n.hentry {}\n.category-misc {}\n.category-example {}\n.tag-news {}\n.tag-wordpress {}\n.tag-markup {}\n.format-image {}\n.format-gallery {}\n.format-chat {}\n.format-link {}\n.format-quote {}\n.format-status {}\n.format-video {}\n<\/pre>\n.hentry je t\u0159\u00edda, kterou WordPress pou\u017e\u00edv\u00e1 p\u0159i vytv\u00e1\u0159en\u00ed Atom Feed.<\/p>\n
Z\u00e1kladn\u00ed styly pro horizont\u00e1ln\u00ed menu:<\/h2>\n
Proto\u017ee menu je pom\u011brn\u011b snadno upraviteln\u00e9 pomoc\u00ed argument\u016f ve funkci wp_nav_menu(), nebudu zde rozepisovat v\u0161echny t\u0159\u00eddy, kter\u00e9 se mohou objevit, ale proto\u017ee m\u00e1 toto b\u00fdt seznam styl\u016f, kter\u00e9 pot\u0159ebujete p\u0159i vytvo\u0159en\u00ed \u0161ablony, uvedu konkr\u00e9tn\u00ed p\u0159\u00edklad:<\/p>\n
wp_nav_menu(\n array(\n 'theme_location' => 'primary-menu',\n 'menu_class => 'm-menu',\n 'container' => 'div',\n 'container_class => 'moje-menu'\n )\n);<\/pre>\nT\u00edm jsme vytvo\u0159ili menu pro Primary menu, kter\u00e9 by m\u011blo vypadat n\u00e1sledovn\u011b:<\/p>\n
\n