How can I show node Hits (statistics)? How can I show Node Hits (Statistics_Counter) in Drupal 8 in a specific place?
I enabled statistics module and I now want to show user hits of a node (node view number/node visits count) in the submitted area instead of in the node links area.

I do this already in Drupal 7 with below code in node.tpl.php:

&lt;?php print (int) $content['links']['statistics']['#links']['statistics_counter']['title']; ?&gt;


What is the equivalent code for Drupal 8?
Drupal 8 uses twig templates so variables are handled/printed in different way.

Node links sections is handled separately because of which we can not hide/remove statistics in node.html.twig file. So to print node statistics count in submitted area, you'll first need to add that to base level of node template like content, author_picture, etc. You can do this by implementing template_preprocess_node() in your theme. Below is sample code which adds new variable containing node statistics count.

function [THEME_NAME]_preprocess_node(&amp;$variables) {
  // Get statistics count for current node.
  $statistics = statistics_get($variables['node']-&gt;id());
  $variables['node_stats'] = \Drupal::translation()-&gt;formatPlural($statistics['totalcount'], '1 view', '@count views');
}


Change THEME_NAME with theme you're using. This will add node_stats variable which you can use inside node.html.twig file for printing node statistics count. Below is how you can print it inside template file.

{% if display_submitted %}
  &lt;div class="node__meta"&gt;
    {{ author_picture }}
    &lt;span{{ author_attributes }}&gt;
      {% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
    &lt;/span&gt;
    &lt;span class="node__stats"&gt;
      {{ node_stats }}
    &lt;/span&gt;
    {{ metadata }}
  &lt;/div&gt;
{% endif %}


This will print the node statistics count in submitted area of content. Links section will still show the node statistics count, to remove this, you will need to create new template file (if not already created) named as links.html.twig. You can copy existing file from "Core => themes => classy => templates => navigation => links.html.twig". After which you can exclude the statistics count from printing. Make sure to rebuild cache after adding new template file. See sample output below:

  &lt;ul{{ attributes }}&gt;
    {%- for key, item in links|without('statistics_counter') -%}
      &lt;li{{ item.attributes.addClass(key|clean_class) }}&gt;
        {%- if item.link -%}
          {{ item.link }}
        {%- elseif item.text_attributes -%}
          &lt;span{{ item.text_attributes }}&gt;{{ item.text }}&lt;/span&gt;
        {%- else -%}
          {{ item.text }}
        {%- endif -%}
      &lt;/li&gt;
    {%- endfor -%}
  &lt;/ul&gt;


We've removed statistics count from links while printing using without() function links|without('statistics_counter')