• Resolved gbonamie

    (@gbonamie)


    I’m trying to set up dynamic conditions for a ‘recently added’ banner that should only appear if the post was posted in, say, the last two weeks. I used the following settings:

    dynamic tag: post date
    condition: greater than
    compare type: string to time
    conditional value: -2 weeks

    This does not work. In the conditional value I have tried variations as well: ‘-2 weeks’, (‘-2 weeks’) but without result. How can I get this right?

    Thanks for any suggestion!

    • This topic was modified 4 years, 8 months ago by gbonamie.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author rtowebsites

    (@rtowebsites)

    Hello @gbonamie

    can you enable debug-mode and copy/paste the result here?

    Thread Starter gbonamie

    (@gbonamie)

    Well, I could, were it not that after updating my Elementor Pro I cannot see the post date field anymore -check screenshot at https://www.screencast.com/t/AnnRygyV0C. As is, I can’t configure my dynamic condition the way it was set up in my first post here.

    Thread Starter gbonamie

    (@gbonamie)

    Right, somehow the post date field showed up. I don’t know what happened there.

    Here is the debug info you asked for:
    Element:image-e20809e (widget)
    DynamicTag-Tag:post-id
    DynamicTag-Key:
    DynamicTag-Value:2196
    Check-Value:-2
    Check-Value2:0
    Condition-Type:strtotime
    Condition:Show if greater
    Condition met:yes

    Plugin Author rtowebsites

    (@rtowebsites)

    Hello @gbonamie

    the debug-info says you have selected “post-id” and not “post-date” as dynamic tag.
    But this is an other problem.
    It seems that the ‘2 weeks’ are converted to ‘-2’. We have reproduced the issue and will fix it soon.

    Thread Starter gbonamie

    (@gbonamie)

    Hi @rtowebsites

    Yes, the post-id was a leftover from stuff I tried out. As in the meantime you have seen for yourself, with post-date it is the same problem.

    Thanks for the follow-up! Awesome that a solution is on its way!
    Geert

    Plugin Author rtowebsites

    (@rtowebsites)

    Hello @gbonamie

    the new Version 1.4.5 should fix this issue.

    Thread Starter gbonamie

    (@gbonamie)

    Hi @rtowebsites
    I have checked and still encounter something rather strange. I have a banner ‘Nieuw’ (‘new’) in the top left corner which has this condition:
    Show when post date (post published) is greater than string to time -2 weeks

    I adjusted the post date of just one item to 5 April. As such, it should be the only test item that meets this condition; all my other test properties were published in February and thus should be failing this. Strangely enough, the debug info that is displayed for these other properties shows incorrect information: check https://www.screencast.com/t/f7wrYrykD and note the values of 1586442002/9 april 2020 for items 2 and 3 (item 1 was the one whose publication date I adjusted), even though the publication date for these items is 20 February (check https://www.screencast.com/t/73qJZnpNz)

    Consequently, I am seeing the banner ‘new’ on every post, which is not the result I was hoping to see.

    Can you do something with this information?
    Geert

    Plugin Author rtowebsites

    (@rtowebsites)

    Hello @gbonamie

    thanks for reporting this. There was really a bug that only took the value of the first post in a loop.
    Has now been fixed in 1.4.6.

    Thread Starter gbonamie

    (@gbonamie)

    Hi @rtowebsites

    Fantastic -this fixed it! Thanks a bunch!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Show element if posted in the last two weeks’ is closed to new replies.