Tagged: related_posts, wpml
-
AuthorPosts
-
October 7, 2015 at 11:06 am #515079
My problem appears in the secondary language only (which may depend on the term_ids). Have a look onto the link in the private section. No related posts are listed, although one of the tags must be found in the news archive (german language works, as You may test). I triggered the problem down to the related-posts.php.
I debugged out the $tag_ids array which is (172,173,82,96). 82 is the relevant term_id, so I tried the following:
‘tag__in’ => array (82), //$tag_ids, WORKS
‘tag__in’ => array (82,172), //$tag_ids, WORKS
‘tag__in’ => array (172,82), //$tag_ids, DOESN’T WORK
‘tag__in’ => array (82,172,82), //$tag_ids, WORKSSeems as if wp_query only respects the first term_id in the array ??
October 8, 2015 at 12:03 pm #515709Hey GeorgLudwig!
try to deactivate all plugins but WPML to check if one is causing this issue.
Regards,
AndyOctober 8, 2015 at 12:40 pm #515726Hi Andy,
I tried by deactivating the plugins. The only effect is when activating/deactivating the Advanced Taxonomy Terms Order which leads to related posts of either the first or the second tag, but not both. This was what I expected – the ATTO simply reorders the taxonomy. The problem is still, that only the first term_id in the array is resprected. You can monitor this with the link given before. German shows 6 related posts while english does only 5. The missing one is tagged with “factory”. When I deactivate the plugin only one related post is listed – which is the missing one from the previous example.October 8, 2015 at 1:52 pm #515785Hi!
so it works fine when you deactivate all plugins but WPML? try to contact plugin’s author for a possible solution.
Best regards,
AndyOctober 8, 2015 at 2:35 pm #515815Hi Andy,
It does NOT work – it only switches the problem. When active the related posts of tag1 are shown, when not the posts of tag2. But NOT as in german all related posts of tag1 AND tag2. It’s not the problem of the ATTO-plugin!
As I told You in the beginning – it depends of the order in the tag__in-array. Only the very first term_id inside is taken into the query!
Regards,
GeorgOctober 9, 2015 at 7:02 am #516180Hey!
I checked the link above but I don’t see any related posts so I think you modified something. Please post the login details here so that we can check the site. Did you translate the tags properly? Please refer to this link: https://wpml.org/documentation/getting-started-guide/translating-post-categories-and-custom-taxonomies/
Regards,
IsmaelOctober 9, 2015 at 9:03 am #516237Hi Ismael,
sorry for the confusion. The example used in my last comment was taken from then development site (link in the private section as well as the admin access).Of course the tags are translated correctly – otherwise my indroducing example by modifying the tag__in-arry in related-posts.php would’nt have give results.
Georg
October 10, 2015 at 12:37 pm #516770Hey!
I checked the tag_id variable and it returns an array with the id 87 and 2, if I am not mistaken, which are the ids for the “product” and “customization” tags. However, I think the problem is that you created a post and another page with the exact same name and slug as the “Customization” tag. Please try to remove the post and the page.
Cheers!
IsmaelOctober 10, 2015 at 6:26 pm #516855Hey Ismael,
1) Not sure, where You looked into – I added a debug in related-post printing out the tag-ids. it’s Array ( [0] => 159 [1] => 82 )
2) Selecting the wp_terms gives:
82 Customization customization-tag 0 14
159 Product product 0 0
3) There is a page customization, but the slug is different (customization, customization-tag)
4) There is no page “product”
5) The query limits by post_type so there should occur no problem neither
6) In German there are related pages an no problem occurs
7) On page http://www.georg-ludwig.com/common/sohle-und-plateau-aus-naturkork You see the posts tagged with ‘product’ – as 159 is the first item in the array
8) I change the array in related-posts.php to $tag_ids= array(82,159); and all posts tagged with ‘customization’ are shownAs I stated in the opening – something is limiting the results to the term_id given in on the first array-position. I may open a second thread at WPML if You thing this problem isn’t related to enfold. I have the WP_Query-Plugin in this installation, so You may print out the queries an check whether the query create is the problem (pre-processing) or the post-processing.
Cheers,
GeorgOctober 14, 2015 at 4:16 am #518476Hey!
Thank you for the update.
1.) I don’t remember the actual tag ids but I know that they are the ids of the related tags.
2.) I actually changed the slugs of the page and post but it’s still not working.
3.) Number 2.
4.) There is a page called “Customization” with the same slug as the post and tag. I changed both slugs.
5.) Yes, no problem there.
6.) Yes, it works fine on the default language.I tried to login again to the site but the login credentials above is not working.
Cheers!
IsmaelOctober 14, 2015 at 9:40 am #518545Hi Ismael,
I tried with the account data given in https://kriesi.at/support/topic/problem-with-related_posts-in-secondary-language-with-wpml/#post-516237 – works fine. I copied them once again to this entry.Regards,
GeorgOctober 15, 2015 at 2:31 am #519016Hi!
I’m having a terrible net connection, it’s probably working the other day but I can’t access it. Sorry about that. I actually created a few test posts and yes, you’re correct. It doesn’t recognize the posts included on the next tag. I will ask the rest of the support team to check this.
Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.