admin管理员组

文章数量:1313599

So, I created a link in the frontend which allows the user to preview their post. However, when I click on it, it takes me to the published post instead of previewing the changes I made.

Here is what I wrote:

<a href="<?php echo get_preview_post_link($post->ID) ?>" target="wp-preview-<?php echo $post->ID ?>" id="post-preview"> Preview </a>

If I go into wp-admin and preview the post, it works fine.

本文标签: custom post typesPreview url not working outside wpadmin