Andry
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Not able to login admin panelYour login name has incorrect symbols look at them and change it in DataBase of site.
Forum: Developing with WordPress
In reply to: Render an HTML banner from a blockYou need to keep track of the unique identifier for a given block, and then before outputting content do a check i if there is more than one block on the page return return for a particular block.
Forum: Fixing WordPress
In reply to: How to display comments in reverse order with pagination?<?php if (post_password_required()) { return; } $post_id = get_the_ID(); $per_page = 4; $comments_count = get_comments_number($post_id); if (isset($_GET['cpage']) && is_numeric($_GET['cpage'])) { $page = (int)$_GET['cpage']; } $page = get_query_var('cpage'); $page = is_numeric($page) ? (int)$page : 1; $GET_value_filter = filter_input(INPUT_GET, 'filter', FILTER_SANITIZE_ENCODED); ?> <a href="/test/?filter=newest">NEWS COMMENTS</a> <div id="comments" class="company-rewiew-list"> <?php var_dump($page); if (empty($GET_value_filter)) { function custom_default_comments_page1($value) { return 'oldest'; } add_filter('pre_option_default_comments_page', 'custom_default_comments_page1'); wp_list_comments(array( 'type' => 'comment', 'reverse_top_level' => false, 'reverse_children' => false, 'callback' => 'reviews_theme_comment', 'per_page' => $per_page, 'number' => $per_page, 'cpage' => $page, )); } elseif ($GET_value_filter == 'newest') { echo '<h1>We need to show newest order comments</h1>'; $comment_count = wp_count_comments($post_id); $comments_count = $comment_count->approved; $offset = ($page - 1) * $per_page; $args = array( 'type' => 'comment', 'status' => 'approve', 'post_id' => $post_id, 'order' => 'DESC', // Sort comments in descending order (newest to oldest) 'offset' => $offset, 'number' => $per_page, ); $comments = get_comments($args); wp_list_comments(array( // Remove reverse_top_level parameter 'type' => 'comment', 'callback' => 'reviews_theme_comment', 'comments' => $comments, 'total' => $comments_count, 'per_page' => $per_page, )); } ?> </div> <?php function reviews_theme_comment($comment, $args, $depth) { $comment_ID = intval($comment->comment_ID); if (!$comment->comment_parent) { echo '<div class="rewiew-card">'; ?> <div id="comment-<?php comment_ID() ?>" itemprop="review" itemscope itemtype="https://schema.org/Review"> <div class="review_content__text"><?php comment_text(); ?></div> </div> <?php } else { ?> <li id="comment-<?php comment_ID() ?>" class="rewiew-card-item _reply"> <div class="review_content__text"><?php comment_text(); ?></div> </div> </li> <?php } if (($depth == 1)) { echo '</div>'; } ?> <?php } ?> <?php if (($per_page > 1) && ($comments_count > $per_page)) { include locate_template('template-parts/custom-comments-pagination.php'); } ?>
@sajjadakbari Unfortunately, the solution you suggested doesn’t work. Here is the full code of the page with comments.
Forum: Plugins
In reply to: [ReWord] Can you add a language version?OK, thank you. I’ll wait for that.
Forum: Plugins
In reply to: [ReWord] add shortcode or block??Yes, this is a very useful suggestion. I am also customizing your plugin and it will be great if I can locate the plugin using a shortcode. (For example For a sidebar element)
You can just make them different. If you have functionality attached to these buttons you can bind it to classes, what’s the problem ?
Forum: Fixing WordPress
In reply to: How to display comments in reverse order with pagination?@sterndata Can you propose other way to show sandbox for WordPress ?
Forum: Fixing WordPress
In reply to: How to display comments in reverse order with pagination?@sajjadakbari Unfortunately, your advice did not solve the problem. Can you show with a real example?
https://alteredspoon.s3-tastewp.com/wp-admin/
[redacted]
I created test post with comments
https://alteredspoon.s3-tastewp.com/test/ and when I push link https://alteredspoon.s3-tastewp.com/test/?filter=newestI need order this comments in correct pagination but it doesn’t work
elseif ($GET_value_filter == 'newest') { echo '<h1>We need to show newest order comments</h1>'; $comment_count = wp_count_comments($post_id); $comments_count = $comment_count->approved; $offset = ($page - 1) * $per_page; $args = array( 'type' => 'comment', 'status' => 'approve', 'post_id' => $post_id, 'order' => 'DESC', 'offset' => $offset, 'number' => $per_page, ); $comments = get_comments($args); wp_list_comments(array( 'type' => 'comment', 'callback' => 'reviews_theme_comment', 'comments' => $comments, 'total' => $comments_count, 'per_page' => $per_page, 'reverse_top_level' => true, )); }
You can correct this code on \wp-content\themes\twentytwenty\template-parts\custom-comments-template.php
- This reply was modified 11 months, 2 weeks ago by Steven Stern (sterndata).
Forum: Fixing WordPress
In reply to: How to display comments in reverse order with pagination?@sajjadakbari Thanks for the explanation, but the solution you suggested doesn’t work.
Yes, you was right.
Thanks.
Forum: Fixing WordPress
In reply to: How to display comments in reverse order with pagination ?It’s test site, and I don’t care about it security. I just need to show that site function didn’t work. Unfortunatly I didn’t find any Sandbox WordPordpress site where users can shared working of site… I just need to show that site function didn’t work. Unfortunatly I didn’t find any Sandbox WordPordpress site where users can shared working of site…
My UM registration form is in a pop-up window in the footer of the site. I initialized it with a shortcode command.
I’m using the hook you suggested so that the correct link is sent in the verification email. It looked something like this
<a style="background:#555555;color:#fff;padding:12px 30px;text-decoration:none;border-radius:3px;letter-spacing:0.3px" target="_blank" data-saferedirecturl="https://www.google.com/url?q=https://test.com?redirect_to%3Dhttps%253A%252F%252Ftest.com%252Freview%252Ftest-r%252Fcomments%252F%26act%3Dactivate_via_email%26hash%3DbjSS2iQuETFoBSO4omOcXcALmvpiabytfCi5H5b3%26user_id%3D35&source=gmail&ust=1699217336493000&usg=AOvVaw0Z_zQN0XvYeFlyo-V5YzSN">Activate your Account</a>
I think that this part of code looks right
redirect_to=https%3A%2F%2Ftest.com%2Freview%2Ftest-r%2Fcomments%2F&
but when I clicked on that link, my site doesn’t redirect me to that URL… It redirects me to a page ‘https://test.com/login/` — It’s page of registration by default in UM plugin.
I checked it. It doesn’t work for me. I received an email notification, and the link in the email redirects me to the
/login/
but I need totrestsite.com/product1/comment-page/
- This reply was modified 11 months, 3 weeks ago by Andry.
Forum: Plugins
In reply to: [ReWord] How to restrict access to the plugin?Yes, understood. Thanks.
If I understand correctly, then this functionality is not present in the current implementation?
Can you please tell me which hook is responsible for this redirect?