{"id":2503,"date":"2015-07-05T12:07:40","date_gmt":"2015-07-05T12:07:40","guid":{"rendered":"http:\/\/musilda.cz\/?p=2503"},"modified":"2015-07-05T12:07:40","modified_gmt":"2015-07-05T12:07:40","slug":"jak-umoznit-v-editoru-vyber-velikosti-pisma","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/jak-umoznit-v-editoru-vyber-velikosti-pisma\/","title":{"rendered":"Jak umo\u017enit v editoru v\u00fdb\u011br velikosti p\u00edsma"},"content":{"rendered":"\n

St\u00e1v\u00e1 se to pom\u011brn\u011b \u010dasto. U\u017eivatel\u00e9 zvykl\u00ed ps\u00e1t ve Wordu, automaticky hledaj\u00ed mo\u017enost nastaven\u00ed velikosti p\u00edsma. Umo\u017e\u0148ete jim to pomoc\u00ed jednoduch\u00e9 \u00fapravy.<\/p>\n\n\n\n

Po instalaci WordPressu, se v editoru zobrazuj\u00ed z\u00e1kladn\u00ed ikony, pro pr\u00e1ci s obsahem, v\u010detn\u011b mo\u017enosti v\u00fdb\u011bru typu prvku. M\u016f\u017eete volit typ nadpisu, citaci, odstavec a dal\u0161\u00ed. V p\u0159\u00edpad\u011b, \u017ee pot\u0159ebujete zm\u011bnit velikost, tak ta tu prost\u011b chyb\u00ed.<\/p>\n\n\n\n

Na\u0161t\u011bst\u00ed sta\u010d\u00ed pom\u011brn\u011b jednoduch\u00e1 \u00faprava m\u016f\u017eete do editoru p\u0159idat v\u00fdb\u011br velikosti a typu p\u00edsma.<\/p>\n\n\n\n

Neupraven\u00fd editor vypad\u00e1 takto<\/p>\n\n\n

\n
\"screenshot-localhost<\/a><\/figure><\/div>\n\n\n

V tuto chv\u00edli pou\u017eijeme filtr mce_buttons_2, kter\u00fd ozna\u010duje um\u00edst\u011bn\u00ed prvku na druh\u00e9m \u0159\u00e1dku ikonek. Do n\u011bj n\u00e1sledn\u011b zav\u011bs\u00edme funkci:<\/p>\n\n\n\n

    function mce_buttons( $buttons ) {\n        array_unshift( $buttons, 'fontselect' );\n        array_unshift( $buttons, 'fontsizeselect' );\n        return $buttons;\n    }\n    add_filter( 'mce_buttons_2', 'mce_buttons' );\n<\/pre>\n\n\n\n

V editoru se n\u00e1m pak objev\u00ed dva nov\u00e9 selecty<\/p>\n\n\n

\n
\"screenshot-localhost<\/a><\/figure><\/div>\n\n\n

Bohu\u017eel jsou jednotky v bodech, ur\u010dit\u011b je budeme cht\u00edt zm\u011bnit na pixely a tak\u00e9 roz\u0161\u00ed\u0159it po\u010det velikost\u00ed.
K tomu vyu\u017eijeme filter tiny_mce_before_init, kter\u00fd se vol\u00e1 p\u0159i inicializaci TinyMce a op\u011bt do n\u011bj zav\u011bs\u00edm jednoduchou funkci.<\/p>\n\n\n\n

function mce_text_sizes( $initArray ){\n        $initArray['fontsize_formats'] = '8px 9px 10px 12px 13px 14px 16px 18px 21px 24px 28px 32px 36px 38px 40px 44px 48px 52px 60px';\n        return $initArray;\n}\nadd_filter( 'tiny_mce_before_init', 'mce_text_sizes' );\n<\/pre>\n\n\n\n

A to je v\u0161e. V editoru m\u00e1me nyn\u00ed mo\u017enost nastvit velikost p\u00edsma a zm\u011bnit font family.
Jen z\u00e1v\u011brem bych cht\u011bl p\u0159ipomenout, \u017ee m\u00e1te mo\u017enost pou\u017e\u00edt i pluginy, jen\u017e umo\u017e\u0148uj\u00ed m\u011bnit nastaven\u00ed editoru, ale zva\u017eoval bych jejich pou\u017eit\u00ed v jednoduch\u00fdch p\u0159\u00edpadech.<\/p>\n","protected":false},"excerpt":{"rendered":"

St\u00e1v\u00e1 se to pom\u011brn\u011b \u010dasto. U\u017eivatel\u00e9 zvykl\u00ed ps\u00e1t ve Wordu, automaticky hledaj\u00ed mo\u017enost nastaven\u00ed velikosti p\u00edsma. Umo\u017e\u0148ete jim to pomoc\u00ed jednoduch\u00e9 \u00fapravy. Po instalaci WordPressu, se v editoru zobrazuj\u00ed z\u00e1kladn\u00ed ikony, pro pr\u00e1ci s obsahem, v\u010detn\u011b mo\u017enosti v\u00fdb\u011bru typu prvku. M\u016f\u017eete volit typ nadpisu, citaci, odstavec a dal\u0161\u00ed. V p\u0159\u00edpad\u011b, \u017ee pot\u0159ebujete zm\u011bnit velikost, tak<\/p>\n","protected":false},"author":1,"featured_media":8624,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,30],"tags":[144,385],"class_list":["post-2503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-navody","category-wordpress","tag-font-size","tag-tinymce"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2503"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=2503"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2503\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8624"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=2503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}