Author Topic: Parse error as I trie to use plugin  (Read 626 times)

Anonymous

  • Guest
Parse error as I trie to use plugin
« on: March 14, 2010, 07:52:47 PM »
Hello there,

I am a beginner in php, so maybe my question is obviouse and if so I appologize. However, I tried to implement the AVH Amazon plugin into one of my wordpress content pages.
I installed the php interpretator so php can be postet in normal pages and added the code:
<?php $avhwidget=& new WP_Widget_AVHAmazon_Wishlist();$avhwidget->widget(array,1); ?>  

and it results in the following error (stars are to protect my structure):

Parse error: syntax error, unexpected ‘,’, expecting ‘(‘ in /home/*******/*******/blog/wp-content/plugins/php-execution-plugin/includes/class.php_execution.php(273) : eval()’d code on line 1

Any idea what I am doing wrong?

Peter

  • Administrator
  • Regular
  • *****
  • Posts: 439
    • http://blog.avirtualhome.com
Re: Parse error as I trie to use plugin
« Reply #1 on: March 17, 2010, 08:45:59 AM »
You're missing the arguments for the widget.
Code: [Select]
<?php $avhwidget=& new WP_Widget_AVHAmazon_Wishlist();$avhwidget->widget(array,1); ?>
should be

Code: [Select]
<?php $avhwidget=& new WP_Widget_AVHAmazon_Wishlist();$avhwidget->widget(array(),1); ?>
But instead of using this method, why not use the shortcode option. When you edit a post/page you can add a shortcode that will basically do the same. There is a box on your edit page to add the shortcode.
Peter van der Does
AVH Plugins developer