1. Home
  2. Docs
  3. Doc of Back Button Widget...
  4. ShortCode
  5. Shortcodes Guide

Shortcodes Guide

 

 

82325c98 392b 4f54 8ab2 46cc4ea3fb38

1079b576 9e4f 4950 8a93 552f7c0a3532

Back Button Widget Pro – Shortcodes Guide

This plugin allows you to add a customizable “Back” button to your WordPress site, enhancing user navigation and site accessibility. The shortcodes are categorized into Free and Pro versions, making it easy for you to implement and customize the back button based on your specific needs.


Free Version Shortcodes

  1. [alg_back_button]
    • Description: Adds a “Back” button to your site, allowing users to return to the previous page. This shortcode can be used anywhere on your WordPress site, including posts, pages, and widgets.
    • Parameters:
      • label (optional): Custom text for the button. Default is “Back”.
      • type (optional): Specify button or text to choose between a button style or plain text.
      • fa (optional): Add Font Awesome icons to the button (e.g., fa=”fas fa-arrow-left”).
      • fa_template (optional): Template for positioning the Font Awesome icon. Default is %icon%.
      • before and after (optional): Text or HTML to add before or after the button.
    • Example Usage: [alg_back_button label=”Go Back” type=”button” fa=”fas fa-arrow-left” before=”<span>” after=”</span>”]
    • Use Case: Place this shortcode on any page or post to add a back navigation button, improving user experience.
  2. [alg_back_button_translate]
    • Description: Allows for the translation of the back button label and other text into different languages. Useful for multilingual sites using WPML or Polylang.
    • Parameters:
      • lang: Specify the language code (e.g., en, fr).
      • not_lang_text: Text to display if the specified language is not active.
    • Example Usage: [alg_back_button_translate lang=”fr” not_lang_text=”Retour”]
    • Use Case: Display the back button label in the appropriate language for your users, enhancing the user experience on multilingual sites.

Pro Version Shortcodes

  1. [alg_back_button_menu]
    • Description: Adds a back button to your WordPress navigation menus. This shortcode allows you to integrate the back button into any menu, making it a seamless part of your site’s navigation.
    • Parameters:
      • menu_id: The ID of the menu where the back button should be added.
      • label (optional): Custom text for the button.
      • fa (optional): Add Font Awesome icons to the menu button.
    • Example Usage: [alg_back_button_menu menu_id=”primary” label=”Back to Menu” fa=”fas fa-arrow-left”]
    • Use Case: Integrate a back button into your site’s navigation menu, allowing users to easily navigate back to previous sections.
  2. [alg_back_button_floating]
    • Description: Adds a floating back button to your site that remains visible as users scroll. You can customize its position, style, and behavior.
    • Parameters:
      • position: Specify the position of the button (e.g., bottom-left, top-right).
      • margin_x and margin_y: Set the horizontal and vertical margins.
      • label (optional): Custom text for the button.
      • fa (optional): Add Font Awesome icons to the floating button.
    • Example Usage: [alg_back_button_floating position=”bottom-right” margin_x=”20px” margin_y=”20px” label=”Go Back” fa=”fas fa-arrow-left”]
    • Use Case: Use this shortcode to add a floating back button that stays in a fixed position on the screen, providing consistent navigation options as users scroll through the page.
  3. [alg_back_button_hide_on_url_param]
    • Description: Conditionally hide the back button based on the presence of specific URL parameters. This is useful for controlling the visibility of the back button in different scenarios.
    • Parameters:
      • param: The URL parameter to check.
      • value: The value of the parameter that triggers the button to be hidden.
    • Example Usage: [alg_back_button_hide_on_url_param param=”hide_back” value=”true”]
    • Use Case: Hide the back button when a specific condition is met, such as a URL parameter indicating a special page or action.

These shortcodes offer flexible and powerful options for adding back navigation to your WordPress site. Whether you want a simple back button, a menu-integrated option, or a floating button, these tools help you enhance user navigation and overall site accessibility. The Pro version expands these capabilities with more advanced customization and conditional display options.

 

Back Button Widget for WordPress

Tags