Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter peterbraishfield

    (@peterbraishfield)

    Thank you. It works now!

    The problem was that I originally wrote (in html): mq_compare_aa=> as suggested by your example. This does not appear to work. I was originally reluctant to write mq_compare_aa=> which looked as if it would confuse the parsing. So wrote mq_compare_aa=’>’. This does work if surrounded by pre and /pre tags, but not otherwise.

    But writing mq_compare_aa=> works under both circumstances.

    If you are interested,
    here are the results of some experiments.

    Thanks very much for your patience.

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Essentially, if the shortcode comparison contains > or < it fails to produce the correct result (producing what = would). The only exception appears to be if the comparison is > and the code is enclosed in pre and /pre tags. Examples in the link.

    For simplicity, there are 4 posts, dated using a meta ‘date’ field in April, May, June and July. The comparison is with the date May 1st.

    Link to example

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Will do.

    For the moment, I’ve hacked your code in pis-functions-queries.php to allow GT,GE,LT,LE as comparison options with the obvious meanings, so that’s circumvented the problem for the moment and taken the urgency away. But it would be much better to get to the bottom of it.

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Failed again.

    Basically, the problem is that if the shortcode contains ‘>’, I cannot get it to work unless it is surrounded by a pre and /pre.

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Let me have another go. There appears to be no way to preview one’s post, so with the large amount of embedded html, fingers vey much crossed:

    I have been experimenting using the classic editor on my test site. All pissc shortcodes appear to work, provided they don’t contain > or <. Also, the following:

    
    <pre> [pissc orderby=meta_value mq_key_aa=date mq_value_aa =2021-05-01 mq_compare_aa ='>' mq_type_aa =DATETIME"] </pre>
    

    works. It gives the right posts in the right order, but it is, as specified, pre-formatted. If

     and 

    are omitted, it gives “no posts yet”.

    Your example also works similarly within

     and 

    , but only if > is changed to ‘>’.  If > is left as it is, it behaves as if the > is ‘=’.

    Again, without the

     and 

    it gives “no posts yet”.

    My assumption is that it must be related to the fact that > and < have to be coded. I’ve tried various browsers and the block editor with similar but not identical results. I remain mystified.

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Very sorry, I’m having terrible trouble with the formatting. I’ll try again later.

    Thread Starter peterbraishfield

    (@peterbraishfield)

    <p>Thanks for the quick reply.
    I have been experimenting using the classic editor on my test site. pissc shortcodes seem to work correctly provided they don’t contain > or <.  When they contain the comparison ‘>’, they generally act as if the comparison is  ‘=’ or unknown. However, if the shortcode is surrounded by

     and 

    , it works.  Thus</p>

    <p>

     [pissc orderby=meta_value mq_key_aa=date mq_value_aa =now mq_compare_aa ='>' mq_type_aa =DATETIME"] 

    </p>

    <p>works: it gives the right posts in the right order, but the result is, as was specified, pre-formatted. If

     and 

    are omitted, it gives “no posts yet”.</p>
    <p>Your example also works within

     and 

    , but only if &gt; is changed to ‘>’. If &gt; is left as it is, it behaves as if the ‘>’ is ‘=’.</p>
    <p>My assumption is that it is related to the fact that < and > have to be coded, but beyond that I remain mystified.</p>

    Thread Starter peterbraishfield

    (@peterbraishfield)

    Should have read:
    This works correctly if it is surrounded by

     ... 

    , but is oorly formatted.

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