title: Get Permalink of included custom post type
body: <p>I have created a site that uses normal posts for news - and a custom post type for projects.</p>
  
  <p>To be able to show the content of the projects in the news section too, I've added a custom option (with ACF) to include the data from a project in a news article. Together with a custom template this has allowed me to let a normal news post look exactly the same as a project. This allows me to show both news and projects chronologically on the home page.</p>
  
  <p>This has one drawback: duplicate content.</p>
  
  <p>To combat this I've added the canonical element in my header.</p>
  
  <p>Where I'm stuck however is that I don't seem to find a way to get the permalink of the included project as the canonical link - as it will of course take the link of the news post.</p>
  
  <p>I am able to get the permalink of the project in the news article - within the loop. Now I need to find a way to get it in the header too - dynamically.</p>
  
  <p>Can this be done with a callback function / action? If so could you provide an example?</p>