View post button
Author | Posts |
---|---|
February 9, 2015 at 2:17 am 36140 | |
Rob | Hi Is there an easy way to add a "view post" button/link into a post edit form? |
February 9, 2015 at 7:24 am 36149 | |
Rob | Actually I seem to have sorted it. Add an action hook in the form (in this case called “view_post_button”) and put the following into functions.php. The button will only appear in an edit post screen, not in a new post (makes sense).
|
February 12, 2015 at 5:58 pm 36588 | |
towhid | Hello Rob, Did you tried your own, then what was the result? I tried in my theme’s functions.php but no button appear in post edit form. |
February 13, 2015 at 2:34 am 36628 | |
Rob | The trick is in the words “Add an action hook in the form (in this case called “view_post_button”)”. In your form, add a field called “action hook” and put “view_post_button” in both fields. Update etc. Then you can style the button using the class “button” I can’t show you mine because it’s on a protected page. That’s it. Hope this helps |