{"id":11756,"date":"2016-05-14T16:58:55","date_gmt":"2016-05-14T16:58:55","guid":{"rendered":"https:\/\/www.grandpacooks.com\/recipes\/?p=11756"},"modified":"2016-05-14T18:09:51","modified_gmt":"2016-05-14T18:09:51","slug":"back-button-for-wordpress","status":"publish","type":"post","link":"https:\/\/www.grandpacooks.com\/recipes\/back-button-for-wordpress\/","title":{"rendered":"Back Button for WordPress"},"content":{"rendered":"<p>This is a webmaster reference page. To see more webmaster reference pages, use the link below.<\/p>\n<p>Occasionally you will have to RETURN to a previous page, such as Chicken Empanadas and Chicken Tinga. The base for both is Poached Chicken.<\/p>\n<p>Rather than repeating the recipe, I am using a back button, so the chef can click to go to the recipe for Poached Chicken, and then return to the recipe on which they were working.<\/p>\n<p>The basic user: What you will see are three back buttons.<\/p>\n<p>Developers:\u00a0 These three buttons are coded slightly differently, but the result is the same &#8211; they return you to the previously viewed page.\u00a0 Some will and some will not work with your specific instance of WordPress.\u00a0 My suggestion to you is to try all three and determine which works best for you.\u00a0 They must be installed on the Text edit screen, not the Visual edit screen.<\/p>\n<p>NOTE:\u00a0 WordPress will probably take control and reformat the button to whichever coding standard your particular theme prefers.\u00a0 Go with it.\u00a0 The functionality is the same.\u00a0 Why should you care how WordPress reformats it.<\/p>\n<p>The script which has generated the button is shown AFTER the instances of the button. Please comment below if this page was helpful to you.<\/p>\n<hr \/>\n<p><button>Previous Page<\/button><\/p>\n<p>&lt;button&gt;Previous Page&lt;\/button&gt;<\/p>\n<hr \/>\n<p><input type=\"button\" value=\"Previous Page\" onclick=\"goBack()\" \/><\/p>\n<p>&lt;input type=&#8221;button&#8221; value=&#8221;Previous Page&#8221; onclick=&#8221;goBack()&#8221;&gt;<\/p>\n<hr \/>\n<p><button onclick=\"goBack()\">This is a Go Back Button<\/button><\/p>\n<p>&lt;button onclick=&#8221;goBack()&#8221;&gt;This is a Go Back Button&lt;\/button&gt;<\/p>\n<hr \/>\n<p>All three methods call a JavaScript function called goBack() which must exist on each page featuring the back button. That script is shown below.<\/p>\n<p>&lt;script&gt;<br \/>\nfunction goBack() {<br \/>\nwindow.history.back()<br \/>\n}<br \/>\n&lt;\/script&gt;<\/p>\n<p><script><function onclick=\"goBack()\" { window.history.back() }><\/script><\/p>\n<p><script>\nfunction goBack() {\nwindow.history.back()\n}\n<\/script><\/p>\n<p>WordPress does, however, do some wonky things with the back button and history, so another option (that I eventually used) is to use a plugin called GoBack<\/p>\n<p>&nbsp;<\/p>\n<p>Copy and paste from below.\u00a0 You will probably have to reformat the double quotes.\u00a0 This must be entered in the Text Edit Mode.\u00a0 If you return to that page, this button will probably break.<\/p>\n<p>&lt;button onclick=&#8221;goBack()&#8221;&gt;Return to Previous Page&lt;\/button&gt;<\/p>\n<p>&lt;script&gt;<br \/>\nfunction goBack() {<br \/>\nwindow.history.back()<br \/>\n}&lt;\/script&gt;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a webmaster reference page. To see more webmaster reference pages, use the link below. Occasionally you will have to RETURN to a previous page, such as Chicken Empanadas and Chicken Tinga. The base for both is Poached Chicken. Rather than repeating the recipe, I am using a back button, so the chef can &hellip; <a href=\"https:\/\/www.grandpacooks.com\/recipes\/back-button-for-wordpress\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Back Button for WordPress&#8221;<\/span><\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[146],"tags":[],"class_list":["post-11756","post","type-post","status-publish","format-standard","hentry","category-webmaster-reference"],"_links":{"self":[{"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/posts\/11756","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/comments?post=11756"}],"version-history":[{"count":11,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/posts\/11756\/revisions"}],"predecessor-version":[{"id":11791,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/posts\/11756\/revisions\/11791"}],"wp:attachment":[{"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/media?parent=11756"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/categories?post=11756"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.grandpacooks.com\/recipes\/wp-json\/wp\/v2\/tags?post=11756"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}