Parse error: syntax error, unexpected T_CLASS in /home/siteadı/public_html/takim/wp-content/themes/gameaddict/widgets/portfoliowidget/portfoliowdg.php on line 1
hatası veriyor
portfoliowdg.php dosyası içi
/*
Plugin Name: Portoflio Widget
Plugin URI: http://www.skywarriorthemes.com/
Description: Display portfolio items
Author: Vojimir Vukojevic
Version: 0.1
Author URI: http://www.skywarriorthemes.com/
*/
class PortfolioItemsWidget extends WP_Widget
{
function PortfolioItemsWidget()
{
$widget_ops = array('classname' => 'PortfolioItemsWidget', 'description' => __('Displays portfolio items with thumbnail', 'addict') );
$this->WP_Widget('PortfolioItemsWidget', __ ('Portfolio Items and Thumbnail', 'addict'), $widget_ops) ;
}
function form($instance)
{
$instance = wp_parse_args( (array) $instance, array( 'title' => '', 'itemsnumber' => '', 'category' => '' ) );
$title = $instance['title'];
$itemsnumber = $instance['itemsnumber'];
$category = $instance['category'];
?>
}
function update($new_instance, $old_instance)
{
$instance = $old_instance;
$instance['title'] = $new_instance['title'];
$instance['itemsnumber'] = $new_instance['itemsnumber'];
$instance['category'] = $new_instance['category'];
return $instance;
}
function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
if (!empty($title))
echo $before_title . $title . $after_title;;
// WIDGET CODE GOES HERE
echo '';
if($instance['itemsnumber'] == ''){$instance['itemsnumber'] = -1;};
$myArray = explode(',', $instance['category']);
$args = array( 'taxonomy' => 'portfolio', 'exclude' => $myArray, 'hide_empty' => true );
$terms = get_terms('portfolio-category', $args);
foreach ($terms as $term) {
$termsarray[]= $term->term_id;
}
$post_ids = get_objects_in_term( $termsarray, 'portfolio-category' ) ;
query_posts(array( 'post_type' => 'portfolio' , 'posts_per_page' => $instance['itemsnumber'], 'post__in' => $post_ids ));
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
wp_reset_query();
echo '';
echo $after_widget;
}
}
add_action( 'widgets_init', create_function('', 'return register_widget("PortfolioItemsWidget");') );
?>
kodla