regression: ignore_sticky_posts is ignored
-
this used to work, but with the latest version, it shows the most recent post instead of the sticky post:-\
see https://bostoncamerata.org/news/
where can i download previous versions?
The page I need help with: [log in to see the link]
-
seems that wptouch handles its homepage redirection separately from its header-link, correctly outputting the url in the latter case & url-encoding the former:-\
i’ll take it up with wptouch, as r2u is functioning as expected.
?? wptouch seems to be afraid to touch sticky posts. I hope they will be able to help.
no, unfortunately, wptouch isn’t very responsive to their forum:-\
as i said, i believe the issue is their handling of their landing page redirection, html-encoding it, causing r2u to miss parameters, which means i can’t debug it:-\
also can u explain this usage?
if ( isset( $_GET['rutpdebug'] ) ) { $this->debug_messages = array(); $this->debug_mode = (int) $_GET['rutpdebug']; if ( 0 == $this->debug_mode ) { $this->debug_mode = 1; } ... }
debug_mode always =1? and then in
private function redirect() { if ( $this->debug_mode ) { ... $this->output_debug_messages();
i’m missing something…
- This reply was modified 4 years, 1 month ago by airdrummer.
i’m just confused by the use of
1264 if ( ! $this->debug_mode )
when it’s set to 1 if 0:108 if ( 0 == $this->debug_mode ) { 110 $this->debug_mode = 1;
gotta go deliver meals-on-wheels now;-)
0: off (parameter not used)
1: on (parameter comes without value, or with 1)
2: on with more detailsThis is for backwards compatibility. The option with 2 was added later.
ah, ok, presence===1
unfortunately, i just hardcoded
379 'ignore_sticky_posts' => false,
and both wptouch & desktop still display latest post instead of sticky post for
https://bostoncamerata.org/?redirect_to=latest
but works as expected for
https://bostoncamerata.org/?redirect_to=latest&ignore_sticky_posts=0
i can’t seem to catch a break:-\
here’s output for
https://bostoncamerata.org/?redirect_to=latest&ignore_sticky_posts=0&rutpdebug=2We use redirect_to=latest. Query parameters:array(8) { ["fields"]=> string(3) "all" ["ignore_sticky_posts"]=> bool(false) ["order"]=> string(4) "DESC" ["orderby"]=> string(4) "date" ["post_status"]=> string(7) "publish" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(100) ["suppress_filters"]=> bool(true) } We found 101 matching post(s) in the database. We filled the cache with a lifetime of 60 seconds. => The resulting URL is: https://bostoncamerata.org/dido-2020/
which is as expected.
here’s https://bostoncamerata.org/?redirect_to=latest&ignore_sticky_posts=1&rutpdebug=2
We use redirect_to=latest. Query parameters: array(8) { ["fields"]=> string(3) "ids" ["ignore_sticky_posts"]=> bool(true) ["order"]=> string(4) "DESC" ["orderby"]=> string(4) "date" ["post_status"]=> string(7) "publish" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(-1) ["suppress_filters"]=> bool(true) } We found 741 matching post(s) in the database. We filled the cache with a lifetime of 60 seconds. => The resulting URL is: https://bostoncamerata.org/filming-begins-for-dido-and-aeneas/
also as expected.
but using the default ignore_sticky_posts hard-coded to false
https://bostoncamerata.org/?redirect_to=latest&rutpdebug=2We use redirect_to=latest. Query parameters: array(8) { ["fields"]=> string(3) "ids" ["ignore_sticky_posts"]=> bool(false) // i've hardcoded to false ["order"]=> string(4) "DESC" ["orderby"]=> string(4) "date" ["post_status"]=> string(7) "publish" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(-1) ["suppress_filters"]=> bool(true) } We found 741 matching post(s) in the database. We filled the cache with a lifetime of 60 seconds. => The resulting URL is: https://bostoncamerata.org/filming-begins-for-dido-and-aeneas/
which is NOT ignoring stickies:-\
- This reply was modified 4 years, 1 month ago by airdrummer.
- This reply was modified 4 years, 1 month ago by Steven Stern (sterndata).
just tried cache=0, still not taking the default of ignore_sticky_posts=>false:
https://bostoncamerata.org/?redirect_to=latest&rutpdebug=2&cache=0
returns:We use redirect_to=latest. Query parameters: array(8) { ["fields"]=> string(3) "ids" ["ignore_sticky_posts"]=> bool(false) // note default ["order"]=> string(4) "DESC" ["orderby"]=> string(4) "date" ["post_status"]=> string(7) "publish" ["post_type"]=> string(4) "post" ["posts_per_page"]=> int(-1) ["suppress_filters"]=> bool(true) } We found 741 matching post(s) in the database. => The resulting URL is: https://bostoncamerata.org/filming-begins-for-dido-and-aeneas/
which is not sticky:-\
- This reply was modified 4 years, 1 month ago by airdrummer. Reason: oops
- This reply was modified 4 years, 1 month ago by airdrummer. Reason: cache=0
cache=0 is also hardcoded? You could also define the constant CHATTY_MANGO_RUTP_CACHE in your wp-config.php and set it to zero.
Anyway, the cache should consider the sticky post parameter. You just need to hardcode it before we create the key for the cache.
I don’t know where you hardcoded that sticky post parameter. Please note that (as we discovered earlier) the query needs
'fields' => 'all'
for sticky posts to work. I see that you often use"ignore_sticky_posts" => false
together with"fields" => "ids"
. So if you want sticky posts, you must also set$this->request_post_objects = true;
. (l. 490-494) (We cannot request always objects because another user reported a memory problem and for random posts we have to use all posts, so here we need IDs.)ok, thanx
- This reply was modified 4 years, 1 month ago by airdrummer.
- This reply was modified 4 years, 1 month ago by airdrummer.
- This reply was modified 4 years, 1 month ago by airdrummer.
- This reply was modified 4 years, 1 month ago by airdrummer.
- This reply was modified 4 years, 1 month ago by airdrummer.
i’ve worked around this problem by setting wpt’s landing page to an existing page, then on the existing page setting a quick-redirect to /?redirect_to=latest&ignore_sticky_posts=0
- The topic ‘regression: ignore_sticky_posts is ignored’ is closed to new replies.