Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Using PHP on the Sidebar or Widget (example: to display a button)

by

Tips and Tricks HQ Support Portal › Forums › General Stuff › Instructions/F.A.Q › Using PHP on the Sidebar or Widget (example: to display a button)

Tagged: PHP, Using PHP on the sidebar, Using PHP on the widget

  • This topic has 0 replies, 1 voice, and was last updated 15 years ago by Ivy.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • May 2, 2010 at 1:15 am #1165
    Ivy
    Member

    You can add button(s) to the sidebar by using a PHP function call.

    Now if you are calling the function from the theme’s template file (sidebar.php, header.php, footer.php etc) then you are fine but there is another way to do this using the widgets which could be more practical in some cases.

    1. Download and activate a PHP executable plugin (there are many) if you don’t have one already:

    a) Executable PHP code plugin – http://wordpress.org/extend/plugins/php-code-widget/

    b) Widgetify – http://wordpress.org/extend/plugins/php-widgetify/

    c) You can find many more plugins here: http://wordpress.org/extend/plugins/search.php?q=PHP+executable&sort=

    These plugins let you call php functions from the widgets (it’s similar to the Text widget but it lets you execute PHP code too).

    2. Go to the widgets menu and add a “PHP Code” widget to the sidebar (where you want to display the “Add to Cart” buttons for example). Now, you can enter PHP code in this widget to display the button for example:

    <?php echo print_eStore_buy_now_button(1); ?>

    This will display a ‘Buy Now’ type button for the product with product id 1.

    You can use any PHP code in a PHP widget.

    Please refer to the WP eStore Shortcodes for a list of available functions:

    http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460

  • Author
    Posts
Viewing 1 post (of 1 total)
  • The topic ‘Using PHP on the Sidebar or Widget (example: to display a button)’ is closed to new replies.

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ