{"id":2852,"date":"2016-04-19T13:43:59","date_gmt":"2016-04-19T13:43:59","guid":{"rendered":"http:\/\/musilda.cz\/?p=2852"},"modified":"2016-04-19T13:43:59","modified_gmt":"2016-04-19T13:43:59","slug":"provazani-obsahu-pomoci-pluginu-posts-2-posts","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/provazani-obsahu-pomoci-pluginu-posts-2-posts\/","title":{"rendered":"Prov\u00e1z\u00e1n\u00ed obsahu pomoc\u00ed pluginu Posts 2 Posts"},"content":{"rendered":"\n
Vazby mezi obsahem, prolinkov\u00e1n\u00ed, souvisej\u00edc\u00ed p\u0159\u00edsp\u011bvky, nazv\u011bte to jak budete cht\u00edt, jsou \u010dasto zmi\u0148ovan\u00fdm zp\u016fsobem, jak nab\u00eddnout \u010dten\u00e1\u0159i podobn\u00fd zaj\u00edmav\u00fd obsah. Z\u00e1rove\u0148 tato technika p\u0159isp\u00edv\u00e1, k lep\u0161\u00edm v\u00fdsledk\u016fm ve vyhled\u00e1v\u00e1n\u00ed. Zde nebudu toto stanovisko obhajovat, nejsem specialista na SEO, ale na mnoha m\u00edstech se zmi\u0148uje pozitivn\u00ed dopad, propojen\u00ed obsahu.<\/p>\n\n\n\n
Existuj\u00ed r\u016fzn\u00e9 „Souvisej\u00edc\u00ed p\u0159\u00edsp\u011bvky“ pluginy, v des\u00edtk\u00e1ch variant, ale tyto pluginy, nar\u00e1\u017e\u00ed na sv\u00e9 hranice, p\u0159i pou\u017eit\u00ed r\u016fzn\u00fdch druh\u016f obsahu. Jednodu\u0161e, p\u0159\u00edsp\u011bvky, na str\u00e1nce s nimi nezobraz\u00edte.<\/p>\n\n\n\n
Na\u0161t\u011bst\u00ed, existuje plugin Posts 2 Posts, kter\u00fd vytvo\u0159il Scribu, jm\u00e9no, kter\u00e9 nen\u00ed nezn\u00e1m\u00e9, v\u0161em, kdo se kolem WordPressu pohybuj\u00ed. Dlouhou dobu byl jedn\u00edm z v\u00fdvoj\u00e1\u0159\u016f WP CLI rozhran\u00ed. O kvalit\u00e1ch pluginu mluv\u00ed i to, \u017ee s p\u0159\u00edpravou nov\u00e9 verze WordPressu, se v\u017edy objev\u00ed diskuze o za\u0159azen\u00ed pluginu do j\u00e1dra.<\/p>\n\n\n\n
Co tedy Posts 2 Posts dok\u00e1\u017ee?<\/strong><\/p>\n\n\n\n Zjednodu\u0161en\u011b \u0159e\u010deno, prov\u00e1\u017ee r\u016fzn\u00e9 druhy obsahu. \u010cl\u00e1nky se str\u00e1nkou, custom post type s custom post type, jak jen budete cht\u00edt.<\/p>\n\n\n\n P\u0159\u00edklad:<\/strong><\/p>\n\n\n\n Budete m\u00edt custom post type Projekt a \u010dl\u00e1nky, kter\u00e9 se budou t\u00fdkat pr\u00e1v\u011b uskute\u010dn\u011bn\u00fdch projekt\u016f. Vytvo\u0159\u00edte si spojen\u00ed, mezi Projekt a \u010dl\u00e1nky a pak ji\u017e jen budete vyb\u00edrat, kter\u00e9 \u010dl\u00e1nky se k projektu p\u0159i\u0159ad\u00ed. Naprosto ide\u00e1ln\u00ed po n\u00e1v\u0161t\u011bvn\u00edka a pro SEO.<\/p>\n\n\n\n Bohu\u017eel, plugin nepat\u0159\u00ed mezi ty, kter\u00e9 nainstalujete a m\u016f\u017eete jen klikat. Propojen\u00ed mus\u00edte vytv\u00e1\u0159et.<\/p>\n\n\n\n Na za\u010d\u00e1tek si uk\u00e1\u017eeme propojen\u00ed str\u00e1nky a \u010dl\u00e1nk\u016f. Do functions.php vlo\u017e\u00edte tento k\u00f3d:<\/p>\n\n\n\n Vytvo\u0159ili jste tak propojen\u00ed \u010dl\u00e1nk\u016f a str\u00e1nek. V detailu str\u00e1nky pak uvid\u00edte nov\u00fd metabox:<\/p>\n\n\nfunction my_connection_types() {\n p2p_register_connection_type( array(\n 'name' => 'posts_to_pages',\n 'from' => 'post',\n 'to' => 'page'\n ) );\n }\n add_action( 'p2p_init', 'my_connection_types' );<\/pre>\n\n\n\n