{"id":617,"date":"2020-12-03T11:59:17","date_gmt":"2020-12-03T08:59:17","guid":{"rendered":"https:\/\/www.etemkeskin.com\/?p=617"},"modified":"2020-12-03T11:59:20","modified_gmt":"2020-12-03T08:59:20","slug":"copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin","status":"publish","type":"post","link":"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/","title":{"rendered":"Copy the Content from the Original Post When Using WordPress Polylang Plugin"},"content":{"rendered":"\n<p>If we have a website built with WordPress and we want to add multi-language support to it, one of the best free plugins we can use in WordPress is <strong>Polyang<\/strong>.<\/p>\n\n\n\n<p>When using the free version of the Polylang plugin, we will see that the translation does not come with the original content when we want to translate blog posts or web pages. To solve this, we need to copy the following code blocks into the theme&#8217;s <strong>functions.php<\/strong> file.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"php\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Copying content when creating a translation with Polylang\nfunction jb_editor_content( $content ) {\n\/\/ Polylang sets the 'from_post' parameter\n    if ( isset( $_GET['from_post'] ) ) {\n        $my_post = get_post( $_GET['from_post'] );\n        if ( $my_post )\n            return $my_post->post_content;\n    }\n\n    return $content;\n}\nadd_filter( 'default_content', 'jb_editor_content' );\n\n\/\/ Copying content when creating a translation with Polylang\nfunction jb_editor_title( $title ) {\n\/\/ Polylang sets the 'from_post' parameter\n    if ( isset( $_GET['from_post'] ) ) {\n        $my_post = get_post( $_GET['from_post'] );\n        if ( $my_post )\n            return $my_post->post_title;\n    }\n\n    return $title;\n}\nadd_filter( 'default_title', 'jb_editor_title' );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If we have a website built with WordPress and we want to add multi-language support to it, one of the best free plugins we can use in WordPress is Polyang. When using the free version of the Polylang plugin, we will see that the translation does not come with the original content when we want [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Copy the Content from the Original Post When Using Wordpress Polylang Plugin - blog website<\/title>\n<meta name=\"description\" content=\"When using the free version of the Polylang plugin, we will see that the translation does not come with the original content when we want to translate blog posts or web pages. To solve this, we need to copy the following code blocks into the theme&#039;s functions.php file.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Copy the Content from the Original Post When Using Wordpress Polylang Plugin - blog website\" \/>\n<meta property=\"og:description\" content=\"When using the free version of the Polylang plugin, we will see that the translation does not come with the original content when we want to translate blog posts or web pages. To solve this, we need to copy the following code blocks into the theme&#039;s functions.php file.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/\" \/>\n<meta property=\"og:site_name\" content=\"blog website\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-03T08:59:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-03T08:59:20+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.etemkeskin.com\/#website\",\"url\":\"https:\/\/www.etemkeskin.com\/\",\"name\":\"blog website\",\"description\":\"Etem KESK\\u0130N\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.etemkeskin.com\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/#webpage\",\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/\",\"name\":\"Copy the Content from the Original Post When Using Wordpress Polylang Plugin - blog website\",\"isPartOf\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#website\"},\"datePublished\":\"2020-12-03T08:59:17+00:00\",\"dateModified\":\"2020-12-03T08:59:20+00:00\",\"author\":{\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\"},\"description\":\"When using the free version of the Polylang plugin, we will see that the translation does not come with the original content when we want to translate blog posts or web pages. To solve this, we need to copy the following code blocks into the theme's functions.php file.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.etemkeskin.com\/index.php\/2020\/12\/03\/copy-the-content-from-the-original-post-when-using-wordpress-polylang-plugin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ana sayfa\",\"item\":\"https:\/\/www.etemkeskin.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Copy the Content from the Original Post When Using WordPress Polylang Plugin\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.etemkeskin.com\/#\/schema\/person\/dcbc30282861ce578b96a79ce8789629\",\"name\":\"etemkeskin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.etemkeskin.com\/#personlogo\",\"inLanguage\":\"tr\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6af0148b790691ed24ae245fb3dc773b?s=96&d=mm&r=g\",\"caption\":\"etemkeskin\"},\"url\":\"https:\/\/www.etemkeskin.com\/index.php\/author\/etemkeskinyahoo-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/617"}],"collection":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/comments?post=617"}],"version-history":[{"count":5,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions"}],"predecessor-version":[{"id":622,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/posts\/617\/revisions\/622"}],"wp:attachment":[{"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/media?parent=617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/categories?post=617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.etemkeskin.com\/index.php\/wp-json\/wp\/v2\/tags?post=617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}