问题标签 [polylang]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3142 浏览

php - Wordpress:即使术语有对象,get_terms() 也不返回任何内容

如果没有分配帖子,get_terms 的正常行为是不返回术语。但事实并非如此,我可以看到在管理员中分配的术语,还检查了数据库,一切似乎都很好。还要检查此代码:

所以,我的帖子确实有条款,但 get_terms 似乎没有意识到这一点。为什么?

请注意以下事项:

  • 我正在使用带有自定义分类法的自定义帖子类型

  • 我使用 polylang 作为语言插件(但所有帖子和术语似乎都已正确翻译和分配)

0 投票
2 回答
3267 浏览

php - Wordpress - Manually link two post translation with polylang

I am currently developing a plugin for multiposting on multisite wordpress.

I wanted the plugin to work with Polylang, it works well when it comes to setting the right language, but i can't find a way to connect to its other translations ( when i post from a blog to the others, otherwise on the same site, it works ).

I've searched in their documentation, and through their plugin, but did not found something that could actually help me.

Do you have any idea how I can set manually the link between translations of the same post ?

Thank's by advance ! :)

0 投票
2 回答
238 浏览

wordpress - 永久链接更改后站点链接断开 (404)

我刚刚更改了我的永久链接结构

https://www.maleq.org/en/first-coming-british-royal-family/

https://www.maleq.org/first-coming-british-royal-family/

删除 url 中的 /en/ sub。现在,尽管我在社交媒体上发布的所有 l=previous 链接都已损坏,并且我的所有谷歌流量都没有正确定向。因此,所有带有 /en/ 的链接都会出现 404 页面错误。

我曾尝试修改 .htaccess 文件夹,但运气不佳。

任何帮助都非常感谢!

0 投票
1 回答
1655 浏览

php - Polylang home url 修改

我正在开发一个网站,其主页是由我创建的自定义模板制作的。到达那里后,您可以进入该站点并查看最新帖子。

问题是,当我查看最新帖子并想更改网站语言时,它会将我带回登录页面。我知道这是正确的行为,因为那是主页。

但是如何修改它以使语言切换器不会将我带到登录页面,而只会更改最新帖子的语言?

假设主站点 URL 是: http ://example.com/en/home

最新的帖子网址是: http ://example.com/en/

提前致谢。

0 投票
3 回答
369 浏览

wordpress - How to maintain specified fields invariate between linked custom posts with polylang

I've create some custom posts on my customized theme in wordpress, in which the polylang plugin is activated.

The translation works well, but the problem is that I need that specified contents remain the same between translated posts. With the normal posts you can deactivate the translation for the media type, but this will not apply for custom content type.

For example, if I got two languages, like English and Spanish, and I create a new custom english post:

I'd want that on the spanish post some of the contents to be already populated with some of the contents that I've already written\uploaded in the english post (the ones with the "*" ), like:

For the custom posts I'm using the CMB2 plugin.

Is there an elegant way to do this?

0 投票
1 回答
374 浏览

wordpress - 类别中的帖子不会以第二语言显示

我正在使用 Polylang 插件来翻译我的网站。在没有任何类别的第二个语言帖子中不显示!在选项阅读中 - 最大帖子编号值为 10。虽然在一个类别中我的帖子少于 10 个,但它可以工作,但对于 11 个或更多帖子不显示在类别中!!!我怎样才能解决这个问题?

0 投票
0 回答
33 浏览

wordpress - Wordpress 多站点和多语言

我目前有一个在以下 url 上运行的 Wordpress 网站:

博客.mycompany.com

该站点有 3 种语言 nl、fr 和 en => polylang 插件用于此,它将对应于以下 url:

  • blog.mycompany.com/language/nl
  • blog.mycompany.com/language/fr
  • blog.mycompany.com/language/en

现在这个博客现在也将在其他国家使用,但在同一个域上。

但是国家之间的内容必须分开。所以我使用子目录创建了一个站点网络。

现在我希望网址如下:

  • blog.mycompany.com/be-nl
  • blog.mycompany.com/be-fr
  • blog.mycompany.com/be-en
  • blog.mycompany.com/nl-nl
  • blog.mycompany.com/es-es
  • ...

仍在使用我们的 wpml 的 polylang,但我不知道如何实现这一点,我希望有一些很棒的技巧可以帮助我实现这一目标。

0 投票
0 回答
149 浏览

wordpress - Wordpress 和 Polylang:与元字段中的“wp_insert_post_data”和帖子名称冲突

我有我的自定义帖子类型,polylang 与它们配合得很好。

但是,为了加快插入过程,当我发布新帖子时,我不需要写名字,因为它是通过组合2个元自动得到的。这是我使用的脚本(我没有信用,我从这里得到它:https ://wordpress.stackexchange.com/questions/94364/set-post-title-from-two-meta-fields )

问题:当我点击帖子时,我得到了正确的永久链接: http : //example.com/en/my-post-type-slug/postname http://example.com/fr/my-post-type-slug /postname-2

(其中帖子名称= meta1meta2)

但是,如果我尝试访问这些地址,wordpress 什么也找不到,并且指向其他语言的链接也不起作用……</p>

我确实尝试停用或重新激活插件,重新保存永久链接结构,但没有任何效果。仅当我注释掉那段代码时才有效……任何想法?谢谢!!

0 投票
1 回答
54 浏览

php - 删除 Wordpress 多语言网站上的数字 (/en/blog-2)

所以我在 Wordpress 上创建了一个多语言(使用 Polylang)网站,并且在那里有一个博客。所有 URL 都以语言 slug 开头,然后是页面/帖子名称。当然,我有 3 个博客页面,但是有没有办法从他们的 slug 中删除数字?我已经在 url 上有了语言 slug,所以没有 blog-2 和 blog-3 会很棒。看起来有点糟糕。

0 投票
1 回答
996 浏览

wordpress - woocommerce类别翻译

我正在尝试使用 WooCommerce 和 Polylang 创建一个网上商店。当我单击产品类别中的“+”图标以将其翻译成法语时,我会转到“新类别”表单。

在我用法语('libre')创建“书”类别后,我看到“书”类别包含 8 个项目,而“自由”类别包含 0 个项目。

在 Polylang / WooCommerce 中,项目之间的关系“在翻译中丢失”是一个已知问题吗?

如果我想要一个可国际化的网店,与网站+博客集成,我应该尝试另一个网店实现吗?