• I seem to be having an issue where stacking shortcodes creates an issue.

    [timelord from=”2015-07-07″ to=”2016-07-07″ every=”7 days”]SOME[/timelord][timelord from=”2015-07-03″ to=”2016-07-01″ every=”7 days”]SOME2[/timelord][timelord from=”2015-07-05″ to=”2016-07-01″ every=”7 days”]SOME3[/timelord]

    Yields

    SOMESOME2SOME3

    It appears that the first time stamp behaves appropriately, and all others after that are ignored.

    https://ww.wp.xz.cn/plugins/time-lord/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hello,

    in your examples, the content should be visible for 7 days and then for the next 7 days it should be hidden and so on.

    From your message I can make a guess that you wanted to show the content once every 7 days (e.g. show it on July 7, then hide it and show it again on July 14 and so on). Is that correct?

    Thread Starter cgorrell

    (@cgorrell)

    Yes that’s correct. I am trying to use this in conjunction with a plugin called maps marker pro where I have the popup text for the map marker say something different for each day of the week.

    I seem to be having trouble getting time lord to work with the marker popup as well.

    Thread Starter cgorrell

    (@cgorrell)

    Here is what the plugin creator for maps marker said about the popup issue:

    Hi CJ,
    created demo maps with timelord at
    https://www.mapsmarker.com/dev/pro/2015/07/08/timelord-test/

    the shortcode is parsed correctly into html, as you can see from the geojson
    output:
    “text”:”SOME CONTENT<span class=’timelord-message-to’></span>

    <span
    class=’timelord-message-to’></span>”,
    it seems, the issue here is that the timelord plugin cannot replace the text
    when on the map – I would suggest asking the plugin developers for assistance
    here.
    best,

    Robert

    I believe that the issue here is that the way the shortcode works, it iterates the content every 7 days, for a duration of 7 days. For example, this:

    [timelord from="2015-07-01" to="2016-07-01" every="7 days"]SOME CONTENT[/timelord]

    will show “SOME CONTENT” from July 1 to July 7 and then it will hide it from July 8 to July 14 (and so on). Could you please try the following shortcodes, to make sure that this is actually the case?

    [timelord from="2015-07-01" to="2016-07-01" every="7 days"]SHOULD BE HIDDEN[/timelord]
    [timelord from="2015-07-05" to="2016-07-01" every="7 days"]SHOULD BE VISIBLE[/timelord]

    If I am correct, the content of the first shortcode should be hidden today (July 9) and the second one should be visible.

    Followup: I did some modifications to the plugin to fit your needs. You can download a modified version here: https://dl.dropboxusercontent.com/u/38634/Transfers/time-lord.zip

    To use it, remove the current version of the plugin and then install and activate the modified one. Then, you can use shortcodes like this:

    [timelord from="2015-07-01" to="2016-07-01" every="Thursday"]SHOULD BE VISIBLE EVERY THURSDAY[/timelord]

    That way you can have your content visible on certain days of the week (e.g. every Monday, Sunday etc).

    I tested it locally and it seems to work. Give it a try and let me know if it works for you.

    Thread Starter cgorrell

    (@cgorrell)

    SO I tried the modification and It works in a post, but for some reason I can’t get it to work in maps marker. I added the shortcode you gave me verbatum and also posted up one with the every set to wednesday. On the marker popup, both shorcodes displayed their content.

    Do you, by any chance, insert the map via a shortcode? For example, do you use this structure:

    [map_shortcode]
    [timelord][/timelord]
    [/map_shortcode]

    If so, it might be an issue with the shortcodes nesting. I believe that you cannot nest shortcodes that way. Check this question at Stack Overflow, which is relevant to the issue: http://stackoverflow.com/questions/4773186/shortcodes-inside-a-shortcode-wordpress

    Thread Starter cgorrell

    (@cgorrell)

    I don’t stack them. Here is the response from the map maker plugin creator:

    regarding time lord: did some more tests with the updated plugin package on my
    server – unfortunately with no positive results. From what I can see, there
    still seems to be an issue within that plugin – although I cannot figure out
    what exactly from the timelord plugin is causing this. I also tried changing
    Maps Marker Pro Geojson output, but this did not have any effect – the shortcode
    was parsed, but content not shown. I would suggest asking the developer to
    create a testcase within Maps Marker Pro – set up a layer map, assign a marker
    with timelord shortcode to that layer map and watch the geojson output (like
    https://www.mapsmarker.com/dev/pro/wp-content/plugins/leaflet-maps-marker-pro/leaflet-geojson.php?layer=57)
    so that he might be able to better debug this.

    Unfortunately the same goes for the plugin
    https://ww.wp.xz.cn/plugins/shortcodes-to-show-or-hide-content/ – also did
    some tests here and from my point of view, everything seems to be ok within Maps
    Marker Pro.

    Sorry for not having better news here – if the plugin developers need more infos
    about Maps Marker Pro, they can of course contact me – just give them my email
    [email protected]
    best,

    Robert

    Hello,

    I tried to replicated the issue using the trial version of the Map Marker plugin. So I created a new marker in which i put these shortcodes: https://dl.dropboxusercontent.com/u/38634/TMP/tests/map-admin.png

    Here you can check the result I get: http://demos.gsarigiannidis.gr/tl-test/

    It seems that in my case it works as expected, right?

    The only thing I can think of is that perhaps some of your installed plugins or your theme conflicts with one of the two plugins (Timelord or Maps Marker). To confirm it you could try testing it with all other plugins disabled and if it doesn’t work, with a different theme.

    Thread Starter cgorrell

    (@cgorrell)

    I can get it to work if I use a marker map, but if you make a layer map, assign the marker to that layer and view the marker in a layer, then timelord doesn’t work.

    i.e. To have multiple markers on one map all taking advantage of timelord’s nifty work.

    OK, I managed to replicate the issue, but unfortunately I don’t know what’s causing it. Perhaps it has something to do with the way shortcodes are being filtered when content is displayed in the layers popup. I tried a few more shortcodes, besides Time Lord’s, and their output also seems to be corrupted. For example, the WordPress’ default [gallery] shortcode shows some extra < br /> tags when displayed in the popup, while everywhere else its code is clean.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Stacked shortcodes’ is closed to new replies.