title: How would you enqueue scripts in wordpress to show only on single posts & blog pages?
body: <p>How would you enqueue a script in a theme that you only want to show on the blog and single posts?</p>
  
  <p>I checked other questions here but didn't get convincing answer.</p>
  
  <p>I got the following code from Wordpress site from a question as :</p>
  
  <pre><code>function enqueue_files() {
    if ( is_page( 'your-page' ) ) {
      // enqueue specific page script files here
    } else {
      // enqueue common scripts here
    }
  }
  add_action( 'wp_enqueue_scripts', 'enqueue_files' );
  </code></pre>
  
  <p>So after taking a look at <a href="https://developer.wordpress.org/reference/classes/wp_query/is_page/" rel="nofollow noreferrer"><strong><code>is_page()</code></strong></a> function I am confused that as I need to only show them at single posts &amp; blog pages and while the following function would work only for static pages and since I want it to be dynamic for all of single posts pages and blog pages so how would I be able exactly to do that then with which function?</p>