Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 56 total)
  • Author
    Posts
  • in reply to: WPML and "Read more…" translation problems #21790
    Samuel
    Participant

    Hi Tom, (if you can delete my previous message please)

    Here is a solution from WPML Support :

    This is how the WP Show Posts plugin works. The lists are a CPT and its content needs to be translated as posts, and to display it properly the plugin author/developer needs to set the proper post ID inside the shortcode.

    imho, this is a feature request that needs to go to the plugin author.

    We found a workaround though:
    – Add the following code to Appearance > Theme Editor > functions.php

    add_filter('wpsp_read_more_output', 'wpml_fix');
     
    function wpml_fix($output) {
        $output = sprintf('<div class="wpsp-read-more"><a title="%1$s" class="%4$s" href="%2$s">%3$s</a></div>',
        the_title_attribute( 'echo=0' ),
        esc_url( get_permalink() ),
        __('Read more fixed', 'wpml-fix'),
        esc_attr( 'wpsp-read-more'));
     
        return $output;
    }

    -Replace “Read more fixed” with the text you want to display in the front end
    -Scan the theme for strings
    -Translate the text in WPML > ST (it will show up under the domain “wpml-fix”)

    This is almost working, except it’s breaking how WPSP is displaying the button and how we asked him to behave (function for redirecting to custom URL). You can see a test example here : https://miviajeporcolombia.com/test-33-es/

    If button style can be reproduce by CSS, I don’t know how to make the custom redirection function working in the spanish version of my website. The redirection function you gave me was in my function.php I moved it to Elements to be able to translate it. So I have now a Hook with the redirection function active in spanish version. But it’s not working.

    in reply to: Related Post #21783
    Samuel
    Participant

    Hi Tom,

    This is not working, returning a “no found” message.

    in reply to: WPML and "Read more…" translation problems #21713
    Samuel
    Participant

    Hi Tom,

    Thanks, but this function is breaking everything.

    But yes, as an alternative to solve this, I like the idea to force what text would be inside the read more button as I’m only using the button option for this purpose.

    I tried replacing the en_US with fr_FR but it didn’t work either.

    in reply to: Related Post #21710
    Samuel
    Participant

    Hi,

    You proposal is returning a “Sorry, no posts were found.” message.

    BUT, I tried to replace $cat = $cats[0]; with $cat = $cats[1]; and it’s working. I didn’t know that [O] was Category (first level) and [1] was Sub-Category (second level).

    Problem now is that if posts are just in first level, it’s returning a “Sorry, no posts were found.” message.

    Would it be possible to say “Look in $cats[1] but if there is nothing in there then look in $cats[0]” ?

    Or “look in $cats[1 and O] in this order” (priority to 1)

    in reply to: WPML and "Read more…" translation problems #21607
    Samuel
    Participant

    Hi @Tom, I had a reply from WPML Support and it’s not good. Basically their solution is : create a new WPSP list for Spanish posts and insert it manually… obviously this will work, I’ll can translate read more button because it’s a new list… but I mean, this is not what I’m looking for… I have and I’ll have hundreds of WPSP lists, this is an insane solution and “nothing” is not a translation plugin is supposed to do… Here everything is working find, same WPSP list is displaying dynamically posts in spanish perfectly, the only problem is the read more button (because it’s the only “non dynamic” item is this workflow).

    Did they contact you to see how to solve this ? If not, could you contact them ? (here : https://wpml.org/documentation/theme-compatibility/go-global-program/)

    in reply to: Related Post #21583
    Samuel
    Participant

    Hi,

    Here is the debug info :

    array(7) { ["order"]=> string(3) "ASC" ["orderby"]=> string(6) "parent" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(4) ["post_status"]=> array(1) { [0]=> string(7) "publish" } ["tax_query"]=> array(1) { [0]=> array(4) { ["taxonomy"]=> string(8) "category" ["field"]=> string(4) "slug" ["terms"]=> array(1) { [0]=> string(7) ""andes"" } ["operator"]=> string(2) "IN" } } ["post__not_in"]=> array(1) { [0]=> int(497) } }

    The post is this one and category is marked as :

    Andes
    – Bogota

    But WPSP is showing posts from :

    Andes
    – Medellin
    – Santander
    – Zona Cafetera

    in reply to: Related Post #21517
    Samuel
    Participant

    Sorry I wasn’t able to edit my post to make lists more comprehensive…

    I should have put for the first category structure something like this :

    Category
    – Sub Cateogry
    — Sub Sub Category

    Colombia
    – Andes
    — Bogota
    — Medellin
    – Caribean
    — Cartagena
    — Santa Marta

    in reply to: Related Post #21514
    Samuel
    Participant

    Hi Tom, I was using a related post plugin but it was messing out each time I had to debug my website, deactivate/reactivate it, etc. And as I’m using your plugin to show posts, I found it good to know have to add another unnecessary plugin to do the job.

    But there is something I don’t understand, so I made a test, here are my thoughts :

    CATEGORY STRUCTURE

    My Destination category structure was like this :

    Category

    • Sub-Category
      1. Sub-Sub-Category

    For example :

    Colombia
    – Andes
    – Bogota
    – Medellin
    – Caribean
    – Cartagena
    – Santa Marta
    Etc.

    PLUGIN BEHAVIOUR

    I saw that your plugin was able to choose posts in the second level (Sub-Category) because for example :

    • In a post about Cartagena that is classified in the “Colombia/Caribean/Cartagena” category, your plugin was able to display posts from the seconde level “Colombia/Caribean” sub-category only.
    • In comparison, in a post about Bogota that is classified in the “Colombia/Andes/Bogota” category, your plugin was able to display posts from the seconde level “Colombia/Andes” sub-category.

    So basically it was a good point because it seems that your plugin was able to see the second level category (sub-category) and was not just displaying random posts from the first level “Colombia” category.

    (Hope your following me…)

    And I had a hope, that deleting the first level category “Colombia” it could solve my problem. I decided to delete the “Colombia” category which at the end wasn’t very useful anyway.

    NEW CATEOGRY STRUCTURE

    So now my new Destination category structure is like this :

    Category
    – Sub-Category

    For example :

    Andes
    – Bogota
    – Medellin
    Caribean
    – Cartagena
    – Santa Marta
    Etc.

    PLUGIN BEHAVIOUR

    I thought it could change the behaviour of your plugin and permit it to display posts in the second level category.

    But it’s not. It still display same posts… so now just posts in the first level category.

    in reply to: WPML and "Read more…" translation problems #21510
    Samuel
    Participant

    Hi Tom, yes they’re working on it, and they say they’ll contact you, hope you’ll find a solution together ! I’m a bit afraid I’ll have to change plugin that is basically everywhere in my website…

    in reply to: WPML and "Read more…" translation problems #21350
    Samuel
    Participant

    Hi @Tom, as you’ll see there WPML is saying that it’s an incompatibility issue with WPSP. So they are ok to work with you, if they don’t contact you directly, they have a page where plugins and themes author normally contact them : https://wpml.org/documentation/theme-compatibility/go-global-program/
    Hope you guys will find a solution !

    in reply to: Related Post #21234
    Samuel
    Participant

    Well, really I don’t know, I just put the function you gave me, open a random post and copy/paste the debug info…
    I mean I don’t remember which post I opened to get the debug info but let’s imagine it was a post about the city of Bogota as it’s in Category Colombia/Andes/Bogota I imagine it’s displaying posts in the Andes category. But I would prefer that it displays posts in the Bogota category, which is a sub-category of Andes.

    in reply to: Related Post #21201
    Samuel
    Participant

    Hi,

    Here is the output :

    array(7) { ["order"]=> string(4) "DESC" ["orderby"]=> string(6) "parent" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(4) ["post_status"]=> array(1) { [0]=> string(7) "publish" } ["tax_query"]=> array(1) { [0]=> array(4) { ["taxonomy"]=> string(8) "category" ["field"]=> string(4) "slug" ["terms"]=> array(1) { [0]=> string(7) ""andes"" } ["operator"]=> string(2) "IN" } } ["post__not_in"]=> array(1) { [0]=> int(22765) } }

    in reply to: WPML and "Read more…" translation problems #21153
    Samuel
    Participant

    WPML Support ask for your contact @Tom, are you ok to send your email to me ?

    in reply to: WPML and "Read more…" translation problems #21147
    Samuel
    Participant

    Just to be clear here is the “workflow” :

    – I create a category X in French.
    – I translate this category to Spanish, it becomes a category Y in Spanish directly linked to the category X in French.
    – I create an hotel page in French to which I apply category X
    – I translate this page to spanish and it’s automatically applying the category Y to it.
    – I make a WPSP list for the category X.
    – I create a french post where I include this WPSP list which is displaying hotel in French.
    – I translate this post to spanish and it includes the same WPSP list which is displaying hotel in spanish, except button, but normal because this is the only part that is produced by the plugin itself, everything else is produced by translations I’ve made.

    in reply to: WPML and "Read more…" translation problems #21137
    Samuel
    Participant

    @Tom what this config is suppose to solve ? I added it and don’t know what to do next.

    In the WPML administration there is possibility to translate strings, but this only translate the “admin message” inside WPSP, like “Read more text” or “Read more button class” but the backend part, not what’s inside the button frontend as you’ll see here : https://pasteboard.co/JvCQmdL.png

    I translated string “Read more text” with “TEST” and it’s displaying backend obviously.

    Here is a page where you can see the translation issue : texte is in spanish and button is still in French as there is no way to translate it : https://miviajeporcolombia.com/test-22/

Viewing 15 posts - 16 through 30 (of 56 total)