I want to remove the preview button if the post is not yet submitted or saved. When you click the preview button while the post is noy yet submitted at the publish section it will redirect you to a 404 page.
where to edit the codes so that i can make the button
preview hidden if the post is not yet submitted for preview and
show if it is already saved.
I already created an simple solution to this problem
initially the post does not have “post” parameter in the url. When we saved it as a draft, an id for the post will be generated. We can now use the id of the post for our “if” statement.
note that i paste this code in my function.php of my theme.