HTML back button as link
The jump to the previous page can be implemented as a text link, for example. To do this, the following code must be inserted into the HTML:
<a href="javascript:history.back()">Back</a>
HTML back button displayed as a button
If the back button should actually be displayed as a button, you can enable this with the following HTML code:
<input type="button" value="Back" onClick="javascript:history.back()">
Installing the back button in WordPress
You can of course also integrate the above button or code snippet into WordPress
Alternatively, you can also integrate the button via shortcode.
HTML back button as shortcode for WordPress
Insert the following code snippet into your functions.php file of your (child) theme:
function add_back_button_shortcode() {
return '<a href="javascript:history.back();">Zurück</a>';
}
add_shortcode( 'back_button', 'add_back_button_shortcode' );
Then you can use the shortcode [back_button]
to insert the back button into your WordPress
Dieser Beitrag ist auch verfügbar auf:
Deutsch (German)