title: How to add permalink into WP_Query in Wordpress Theme
body: <p>I want to add Blog Page in front-page.php.I want to show only post title with link to actual post.I dont know where to put the_permalink in my code.My code like below:</p>
  
  <pre><code> &lt;div class="profile"&gt;               
                  &lt;?php 
                    $query = new WP_query( 'pagename=blog' ); 
                      if ( $query-&gt;have_posts() ) {
                      while ( $query-&gt;have_posts() ){
                      $query-&gt;the_post();
                      echo '&lt;h2 class="text-center"&gt;' . get_the_title() . '&lt;/h2&gt;';                                
                         }
                       }
                    wp_reset_postdata();
                   ?&gt;   
   &lt;/div&gt;&lt;!--end blog-content --&gt;     
  </code></pre>
  
  <p>When I put ,the hyperlink goes to domain.com/get_permalink() not to actual url.</p>
  
  <p>Example the actual url is domain.com/abc. 
  When I click to the post title,it goes to domain.com/get_permalink()</p>
  
  <p>Anyone can help me to solve my problem? </p>