Ghostwise_
Forum Replies Created
-
Dang, forgot to tick the “fixed” box.
At this point it seems unlikely that there is any link to the Related Post functionality, so I should have ticked that box in my previous post, sorry.
Yeah, I cleared my various caches.
Some more digging (by which I mean trying stuff at random after @kokkieh said he couldn’t reproduce the issue) leads to the conclusion-for-now that it’s specific to an up-to-date Chrome with a 110% zoom (to rest my old eyes).
Behaviour is normal on Firefox, Edge and non-zoomed Chrome. But I can reproduce it semi-consistently on 110% zoomed Chromed, and 100% fix it by shifting back to 100% zoom.
What a strange little curiosity.
Thanks !
The simple possibility now being ruled out, I’ll have to go a-digging.
The behaviour I see in Chrome, on the exact same page, changes when I simply reload.
Frex on one reload I have this — https://www.writeups.org/Large/Div-gap-worg.jpg — where you can see the Related Posts module at the top, the next div, an abnormal empty space, then the content. But If I reload I can have the empty space disappear, with the “Game stats” heading now overlapping with the table underneath — https://www.writeups.org/Large/Div-overlap-worg.jpg .
The only two recent plugin changes have been Jetpack and Redirection. From early tests I’m starting to suspect it may just be the copy of Chrome on one of my machines who started going gaga at more or less the time of these updates, rather than a WordPress issue.
Thanks for helping me get started with this small investigation !
Forum: Plugins
In reply to: [Contextual Related Posts] Posts related to themselvesOdd. Perhaps a cache issue unrelated to the plugin then…
Thanks for your advice, I’ll try to figure this out. ??
Forum: Fixing WordPress
In reply to: Sorting custom columns in admin interface – I'm *almost* thereLatest flailing attempt, using orderby on the meta key but clearly missing something :
////////////////////////////// //Add custom column using the Counts field to the posts admin display ////////////////////////////// add_filter('manage_edit-post_columns', 'my_columns_head'); function my_columns_head($columns) { $columns['Counts'] = 'Counts'; return $columns; } //Add rows data add_action( 'manage_post_posts_custom_column' , 'my_custom_column', 10, 2 ); function my_custom_column($column, $post_id ){ switch ( $column ) { case 'Counts': $views_value = get_field( 'field_5465eef2489a9', $post_id ); echo intval($views_value); break; } } // Make these columns sortable add_action( 'pre_get_posts', 'views_orderby' ); function views_orderby( $query ) { if ( $query->is_admin() && ( $orderby = $query->get( 'orderby' ) ) ) { switch( $orderby ) { case 'Counts': $query->set('meta_key','Counts'); $query->set('orderby','meta_value_num'); break; } } }
Forum: Fixing WordPress
In reply to: Sorting custom columns in admin interface – I'm *almost* thereI had a brief “what if ?” moment and turned echo $views_value; into echo intval $views_value; because heh, maybe the value wasn’t returned as a numerical one ?
Nope.
Forum: Fixing WordPress
In reply to: Need fresh eyes on a short PHP function that doesn't work, pleaseAs it turns out you’ve been even more helpful than I suspected.
I was also using the plugin “Top 10” to keep counts (since my function wasn’t working, you see ?) and apparently it was causing a large performance hit on my site (due to my specific configuration with Varnish caching and whatnot).
Since our function now works I uninstalled the plugin, apparently (fingers crossed!) solving the server load issue that was driving me bonkers.
Victory !
Forum: Fixing WordPress
In reply to: Need fresh eyes on a short PHP function that doesn't work, pleaseI have deployed your proposed solution. I mean, Tintin would never lie to me, would he ? ??
One brief test seems conclusive. Right now I am busy playing whack-a-mole with 404s (big site migration going) but that leaves time for views to accrue so I can see the behaviour of numbers in Count fields.
Thanks muchly.
OK, found the issue in my if clause. Solved !