PAIN. Comments Pagination – WordPress Development Stack Exchange

Sorry for flame, but i wasted 7-12 hours trying to understand how comments pagination works….
Never thought that simple step will take that much with WordPress :'((((

i output comments in my theme like this:

         'callback' => 'regular_comment',
         'avatar_size' => 100,
         'style'       => 'ol',
         'short_ping'  => true,
         'reply_text'  => __( 'Reply', 'twentyseventeen' ) . ' ' . '<img class="comments-icon" src="' . get_path() . '/assets/i/others/chat.svg">',

And trying to use

echo paginate_comments_links();

for outputting pagination. Now after many hours of trying i understood that there is no way to use paginated comments unless you select that option in admin under Settings->Discussion…..


If that option is not set – no matter how hard i try to get total comments and set ‘per_page’ arg for wp_list_comments() – pagination urls ({N}/#comments simply won’t work – url just redicts to

So, i have to setup that option… but. If you let’s say want on one page to show 5 comments per page and 10 on another, then you use ‘per_page’ for wp_list_comments(), right ?

wp_list_comments( ...args, 'per_page' => 5)

while in admin panel we have let’s say 10. After setting this up we need to tell paginate_comments_links() total number of comments on pages, because otherwise it will count using values provided in admin settings(under Settings->Discussion)

paginate_comments_links( array( 'total' => count_number_some_way ) )

In this case we will get pagination numbers as we want, but pagination will only work for pages defined in admin panel…. comments now show up on page according to ‘per_page’ argument for wp_list_comments, but pagination still works only for values in admin panel… It does show different number of pages. For example, we have 12 total comments on post, defined 6 per page in admin panel and now want to display 2 per page via ‘per_page’ argument, so pagination number will increase from 1..2 to 1..2..3..4..5..6. But only 1..2 will work, other links will just output no comments…

development – Is there a way to save a site in SharePoint online as a template programmatically (with an API, PowerShell, C#, etc.)?

I have a SharePoint Online site that has custom scripts enabled, and I want to programmatically save it as a template. I do not want to use PnP Provisioning Templates, I want to access the same functionality as savetmpl.aspx but programmatically. I know that in SharePoint Server you can use the SPWeb.SaveAsTemplate method in PowerShell or C#, but this is not present in SharePoint Online. Is there a way to do this?

I also found the following url: I see ExportWeb listed there. Would this work in SharePoint Online?

I looked at this question, but I do not want to use PnP Provisioning

plugin development – 403 error rest_’cookie_invalid_nonce’ on API Request

I’m currently developing a Plugin in which I’m in need of retrieving information from a third-part plug-in api, to authenticate my users I am using the trying to use the vanilla authentication via cookie as explained in the official documentation but every request is refused with a 403 ‘rest_cookie_invalid_nonce’ code. I cannot understand what I’m doing wrong.

My code:

function makeRequest(){
$url = '';
$nonce = wp_create_nonce('wp_rest');
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  'X-WP-Nonce:'. $nonce,
  'Content-Type: application/json',
$result = curl_exec($curl);
if(!$result){die("Connection Failure");}
return $result + var_dump($nonce);


How to successfully outsource software development?

It is actually extremely difficult to successfully build software through a 3rd party. This is mainly due to costs, time constraints, and limited availability to communicate your vision. If you have the budget and you can find a local software development company that will probably be your better choice since you can attend meetings in person rather than via skype or phone. There is a huge challenge in communicating YOUR vision to someone whose main concern is their time/cost/resources to turn a profit. You almost never get exactly what you want and there’s always a barrier communicating to geeks…

If you aren’t looking for extensive software to be built you can checkout some of the freelance web sites like ODesk. There’s plenty of talented people on there but make sure you talk to them and interview them. Communication, understanding, and patience is key. You may have to pay more money but it will be less in the long run.

Personally I work on my own side projects. I have paid others to contribute and never got my money’s worth. I would advise finding someone young. I dislike “veteran” or “old school” mindset programmers. They have a tendency not to adapt and believe in turning a 3 week project in to a 6 month tedious monster by writing every lick of code. Think @deathshadow .


unicode – PHP Back End Development Assignment

I have been taking a Dynamic Website course and I can’t seem to grasp the content at all! I spend hours a week trying to figure out the basics yet am stuck. I have an assignment to work on and I’m not sure how to even start.

A visitor’s initial access to the application will be through its main page. The main page will be named index.php.
The main page will display a single form composed of a selection field and two text fields.
The visitor will select a course from the selection field.
The visitor will enter a student name in one text field and a student number in one text field. The visitor must not be shown a list of student names or student numbers.
If the student information does not match an existing student record, the visitor must not be told which part of the student information does not match.
If the student name and student number match an existing student record and if the course selected has not reached maximum enrolment and if the student has not enrolled in the course already, the student can be enrolled into the course.
The visitor must be informed of the results of the enrolment attempt and allowed to select from the course list again.

Make no assumptions about which client platform will be used to test and grade the assignment. The application must work equally well with any web browser on any platform. See Any Browser Campaign’s Accessible Design Guide and search the W3C web site for information on accessibility standards. For example, the W3C specification for Tables in HTML documents makes recommendations for designing tables that can be rendered by non-visual user agents.

development – Fetching URL of Document Set in SharePoint Online Library

I am trying to upload different kind of VSTO documents at different Document Set in a Library, so before uploading a document I need to fetch the URL of the page(current DocumentSet URL) to my code as I need to do some manipulation with the URL.

I need the solution with reference to SharePoint Online and in c# language.

20.04 – Optimizing 4GB RAM for Android development using Android Studio 4 on Linux

I am using Android Studio 4 on Ubuntu 20.04 LTS with Intel Corei3 Processor(Intel® Core™ i3-2120 CPU @ 3.30GHz × 4). After starting Android Studio, more than 90% of physical memory gets used. I am not even using any virtual Device with it but connecting my android phone by USB to my PC.

I have run a Hard Disk Health Check and Memtest86 to ensure that the RAM and hard disk is not faulty. None of the two reports any errors.

Hard Disk Health Check:

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
  1 Raw_Read_Error_Rate     0x000b   100   100   016    Pre-fail  Always       -       0
  2 Throughput_Performance  0x0005   136   136   054    Pre-fail  Offline      -       93
  3 Spin_Up_Time            0x0007   121   121   024    Pre-fail  Always       -       190 (Average 190)
  4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       3937
  5 Reallocated_Sector_Ct   0x0033   096   096   005    Pre-fail  Always       -       249
  7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  8 Seek_Time_Performance   0x0005   115   115   020    Pre-fail  Offline      -       34
  9 Power_On_Hours          0x0012   100   100   000    Old_age   Always       -       4904
 10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       3937
192 Power-Off_Retract_Count 0x0032   097   097   000    Old_age   Always       -       4568
193 Load_Cycle_Count        0x0012   097   097   000    Old_age   Always       -       4568
194 Temperature_Celsius     0x0002   181   181   000    Old_age   Always       -       33 (Min/Max 18/49)
196 Reallocated_Event_Count 0x0032   093   093   000    Old_age   Always       -       310
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       0

SMART Error Log Version: 1
No Errors Logged

Complete report is here




# Runs JVM in Server mode with more optimizations and resources usage
# It may slow down the startup, but if you usually keep IDE running for few hours/days
# JVM may profile and optimize IDE better. Feel free to remove this flag.
# -server

#Sets the initial memory allocation pool

#Sets the maximum  memory allocation pool

# Sets the size of the allocated class metadata space that will trigger a GC the first time it
# is exceeded, default max value is 350m


How do I optimize the physical memory or do I really need to consider increasing the system memory(RAM)?

I have gone through this post but really looking if we have any other workaround.

theme development – Loading scripts and stylesheets together failure

I’m trying to load scripts and stylesheets together at same function. At first I loaded stylesheet by itself and it worked after I added admin_enqueue_scripts function in additional to wp_enqueue_scripts.

Now I’m trying to load stylesheets and scripts in the same function, unfortunately that fails to exist, and also prevent CSS to load.

I can’t find any typo’s or something online that related to my issue.

  function loadAssets(){
      wp_enqueue_style( 'style', get_template_directory_uri() . '/css/style.css');
      wp_enqueue_script('jquery', get_template_directory_uri() . '/js/jquery.js');
      wp_enqueue_script('script', get_template_directory_uri() . '/js/script.js');

  //Applying those loading references
  add_action('wp_enqueue_scripts', 'loadAssets');
  add_action('admin_enqueue_scripts', 'loadAssets');

How can I load both JavaScript files and CSS files on the same function?

web development – IP address doesn’t change to the domain name

I am facing this problem for quite a long time. When I enter the IP address of my website it take me to the website but the IP address doesn’t change to the Domain Name. I am hosting my website on a Virtual Machine on Google Cloud. I am using the Google Cloud service as a hosting service for my website. Can someone help me in solving this problem?

Unity development build not connecting to profiler

Thanks for contributing an answer to Game Development Stack Exchange!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

To learn more, see our tips on writing great answers.