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 WordPress does more than 38.8% of all websites on the internet. Yes - more than one in four websites you visit is likely powered by WordPress. • WordPress.org , often as self-hosted WordPress is the free open source WordPress software that you can install on your own web host to create a 100% custom website.• WordPress.com is a for-profit, paid.... However, it is important to know that you must not insert the code snippet in the text editor in “visual” mode, but must first switch the editor to “text” mode (top right). You can only insert HTML code in text mode.
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
WordPress does more than 38.8% of all websites on the internet. Yes - more than one in four websites you visit is likely powered by WordPress. • WordPress.org , often as self-hosted WordPress is the free open source WordPress software that you can install on your own web host to create a 100% custom website.• WordPress.com is a for-profit, paid... page.
Dieser Beitrag ist auch verfügbar auf: Deutsch (German)