Number of post in a query / post slug

Hi all, 2 questions here….

  1. is there any simple code snippets to define the number of post in a loop query according to the responsive breakpoints?
  2. is there a way to call the post slug dynamically in a link?
    (I want the use this addded to a post-url link to scroll to this post in another archive page - as an anchor links )
    Thanks everybody :pray: