Nadeem Khan
Forum Replies Created
-
Forum: Reviews
In reply to: [Gutenberg] Don’t try to fix what’s not brokenwhat you’re finding makes editing more difficult as compared the to the previous text editor?
Its outright horrible and confusing (specially to non-techie writers). Everyone is familiar with MS Word sort of text editors in this age and that’s why everyone expects a MS Word like experience. Forcing this new blocks/toolbar-less/pop-up heaving approach sucks. And, yes MOST people share this opinion of mine (which is evident from the ratings).
P.S. Just go through the comments in 5-star reviews. A lot of people mistakenly didn’t enter the rating and the default 5 stars got selected. Many 5 star reviews are accidental and also hate guttenberg.
What kind of work do you do using WordPress and what type of content do you typically write?
We use WordPress to publish entertainment related text/images based posts.
Forum: Plugins
In reply to: [Yoast SEO] Why is this useless css file being loaded in the frontend?Thanks it worked.
Forum: Hacks
In reply to: How to disable auto wordpress emmed scriptI finally found a solution in the code of Disable Embeds WordPress plugin. Add this code (modified) in your theme’s functions.php file to remove the wp-embed.min.js file from the frontend completely:
function disable_embeds_init() { // Remove the REST API endpoint. remove_action('rest_api_init', 'wp_oembed_register_route'); // Turn off oEmbed auto discovery. // Don't filter oEmbed results. remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10); // Remove oEmbed discovery links. remove_action('wp_head', 'wp_oembed_add_discovery_links'); // Remove oEmbed-specific JavaScript from the front-end and back-end. remove_action('wp_head', 'wp_oembed_add_host_js'); } add_action('init', 'disable_embeds_init', 9999);
Issue resolved by re-saving all the ranks and upgrading to 1.6.4.
I manually added the table names in the query and it started working again.
Here is the code that you gave earlier:
Thanks it worked!
The plugin was working perfectly fine and it was indeed a template related issue as I was checking:
<?php if (have_posts()) : ?>
before
<?php $my_query = new WP_Query('post_type=mycred_rank&posts_per_page=13&order=DESC'); while ($my_query->have_posts()) : $my_query->the_post(); ?>
which is wrong as there aren’t any posts for this page before WP_Query is called. The correct statement is:
<?php if ($my_query->have_posts()) { ?>
and it should be called after the $my_query.
Sorry, it isn’t a 404 with https://example.com/rank but it appears the <?php if (have_posts()) : ?> statement fails and the <?php else : ?> statement is executed.
Regarding changing the url field, when I changed the url in the field to ‘ranks’ and visited “https://example.com/ranks/” after saving the permalinks again in Settings->Permalinks, same else statement is executed in the template.
Yes, ranks are public and I have entered rank in the url field.
Here is the link to the screenshot of my settings:
I have followed the update doc and also tried after resaving the permalinks but I still get a 404. Below is the code of my archive-mycred_rank.php that generates the ranks related output:
<?php if (have_posts()) : ?> <div id="rank-<?php the_ID(); ?>" <?php post_class(); ?>> <table> <?php $my_query = new WP_Query('post_type=mycred_rank&posts_per_page=13&order=DESC'); $index = 0; while ($my_query->have_posts()) : $my_query->the_post(); $users_with_current_rank = mycred_get_users_of_rank(get_the_ID()); $rank_results_count = count($users_with_current_rank); $total_users = count_users(); $percentile = ($rank_results_count / $total_users['total_users']) * 100; $rank_title = get_the_title(); ?> <tr class="rank-table-row"> <td ><h3 class="entry-title rank-title"><a href="<?php echo home_url() . '/rank/' . strtolower($rank_title); ?>" target="_blank"><?php echo $rank_title; ?></a></h3></td> <td ><?php echo $criteria[$index]; ?></td> <td ><?php echo $rank_results_count; ?></td> <td ><?php echo (number_format((float) $percentile, 2, '.', '')); ?></td> </tr> </div> <?php $index++; endwhile; wp_reset_query(); ?> </table> <?php else : ?> <h2 class="center">Not Found</h2> <?php include (TEMPLATEPATH . '/searchform.php'); ?> <?php endif; ?>
It works now, thanks!
A leaderboard with pagination will really be an extremely powerful feature. I too require this feature.
The code you shared in the gist works like a charm. Thanks!
Thanks, worked perfectly ??