Support » Plugin: WordPress Popular Posts » WPML compatibility – links to post no longer working

  • Resolved tadama

    (@tadama)


    Hi, this issue seems new as it worked before. I use WPP with WPML. On the translated category page there is a WPP shortcode. The photos and (text) displayed is correct but the links to the post go to english instead of german
    The shortcode I use has the category no for the english category (which used to work that the links still lead to the german post) like this

    
    [wpp post_html='<li>{thumb}<li>' cat='14' post_type='post' thumbnail_width=150 thumbnail_height=150 stats_views=0 stats_author=1 range=last7days limit=12]

    14 is the english category if I replace with the german category which is 11 there will be “sorry no content”
    I have read through the older thread but think this is a different issue. And as I wrote it used to work.
    Any idea?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi @tadama,

    The code you posted got all messed up because you forgot to use the code button. Assuming you can no longer edit your post (there’s a time limit for that), please upload your shortcode to pastebin.com so I can see it (alternatively, can a moderator please fix OP’s code formatting?)

    Also, I’d like to know:

    • WPML version?
    • WPP version?
    • WordPress version?
    tadama

    (@tadama)

    Here is the code: https://pastebin.com/hnyRwr2K

    WPML version: Version 4.3.4
    WPP version: Version 5.0.1
    Wordpress: Version 5.3

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Hi @tadama,

    The photos and (text) displayed is correct but the links to the post go to english instead of german (…)

    I checked that URL you shared and I don’t see anything out of the ordinary.

    Here’s the HTML output I’m seeing when I visit https://www.urbanchangelab.com/de/category/massanfertigung/:

    <div class="wpp-grid">
        <p></p>
        <ul class="wpp-list">
            <li>
                <a href="https://www.urbanchangelab.com/de/three-cutlery-boxes/" target="_self">
                    <img src="https://www.urbanchangelab.com/wp-content/uploads/wordpress-popular-posts/106930-featured-150x150.jpeg" alt="" class="wpp-thumbnail wpp_featured wpp_cached_thumb" width="150" height="150">
                </a>
            </li>
            <!-- Rest of the code removed for brevity -->
        </ul>
    </div>

    The currently active language is German so WPP is linking to the German version of these articles. Why are you saying that the links are pointing to the English version instead?

    I also checked the English version of that URL (https://www.urbanchangelab.com/category/custom-made/) and likewise the shortcode works as expected:

    <div class="wpp-grid">
        <p></p>
        <ul class="wpp-list">
            <li>
                <a href="https://www.urbanchangelab.com/three-cutlery-boxes/" target="_self">
                    <img src="https://www.urbanchangelab.com/wp-content/uploads/wordpress-popular-posts/106930-featured-150x150.jpeg" alt="" class="wpp-thumbnail wpp_featured wpp_cached_thumb" width="150" height="150">
                </a>
            </li>
            <!-- Rest of the code removed for brevity -->
        </ul>
    </div>

    As you can see, this time the shortcode is using the English URLs. Everything is working as intended.

    14 is the english category if I replace with the german category which is 11 there will be “sorry no content”

    Of course, posts that don’t have the English category will be filtered out. Same applies to the ones that don’t belong to the German category. This is how WPP has always worked, so no issues here either.

    Passing the cat parameter both category IDs should fix the “problem”:

    
    [wpp post_html='<li>{thumb}</li>' cat='11,14' post_type='post' thumbnail_width=150 thumbnail_height=150 stats_views=0 stats_author=1 range=last7days limit=12]
    

    Or you could just remove it altogether:

    
    [wpp post_html='<li>{thumb}</li>' post_type='post' thumbnail_width=150 thumbnail_height=150 stats_views=0 stats_author=1 range=last7days limit=12]
    

    P.S. You didn’t close the <li> tag. I fixed that for you.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Why are you saying that the links are pointing to the English version instead?

    Ah, I see what you meant now. I didn’t click on the links so didn’t notice the problem at first.

    This might be a compatibility issue with WPML 4.3.4 but can’t tell for sure because I have WPML 4.2.6 and on that version I can’t replicate the problem.

    Try downgrading to WPML 4.2.6 and see if that fixes the issue. If it does, then it’s a WPML problem. If it still persists then I’ll be needing more information from you so I can replicate the issue.

    Plugin Author Héctor Cabrera

    (@hcabrera)

    Marking as resolved due to inactivity.

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