title: Wordpress how to get a single post link
body: <p>I want to go to <code>single.php</code> file when  this button is clicked.</p>
  <pre class="lang-php prettyprint-override"><code>&lt;div class=&quot;recepies-search&quot;&gt;
          
          &lt;div class=&quot;card m-1&quot; style=&quot;width: 18rem;&quot;&gt;
    &lt;img class=&quot;card-img-top&quot; src=&quot;&lt;?get_the_post_thumbnail()?&gt;&quot; &gt;
    &lt;div class=&quot;card-body&quot;&gt;
      &lt;h5 class=&quot;card-title&quot;&gt;&lt;?php the_title();?&gt;&lt;/h5&gt;
     &lt;button type=&quot;button&quot; class=&quot;btn btn-warning&quot; onclick=&quot;&lt;?php get_permalink()?&gt;&quot;&gt;click&lt;/button&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  <p>but it doesn't do anything.</p>