Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #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, WORKS

    Seems as if wp_query only respects the first term_id in the array ??

    #515709

    Hey GeorgLudwig!

    try to deactivate all plugins but WPML to check if one is causing this issue.

    Regards,
    Andy

    #515726

    Hi 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.

    #515785

    Hi!

    so it works fine when you deactivate all plugins but WPML? try to contact plugin’s author for a possible solution.

    Best regards,
    Andy

    #515815

    Hi 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,
    Georg

    #516180

    Hey!

    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,
    Ismael

    #516237

    Hi 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

    #516770

    Hey!

    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!
    Ismael

    #516855

    Hey 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 shown

    As 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,
    Georg

    #518476

    Hey!

    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!
    Ismael

    #518545

    Hi 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,
    Georg

    #519016

    Hi!

    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

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.