Tagged: Portfolio, portfolio widget, Widget
Hi i am creating a custom portfolio widget base on a custom posttype.
but i am getting an error: Class ‘avia_newsbox’ not found
mine code in fiunctions.php goes like this:
must be forgetting something?
`/**
* AVIA PORTFOLIOMODELBOX
*
* Widget that creates a list of latest Custom Post type Model entries. Basically the same widget as the newsbox with some minor modifications, therefore it just extends the Newsbox
*
* @package AviaFramework
* @todo replace the widget system with a dynamic one, based on config files for easier widget creation
*/
if (!class_exists(‘avia_portfoliomodelbox’) && class_exists(‘avia_newsbox’) )
{
class avia_portfoliomodelbox extends avia_newsbox
{
function __construct()
{
$this->avia_term = ‘model_categories’;
$this->avia_post_type = ‘model’;
$this->avia_new_query = ”; //set a custom query here
$widget_ops = array(‘classname’ => ‘newsbox’, ‘description’ => __(‘A Sidebar widget to display latest portfolio entries in your sidebar’, ‘avia_framework’) );
WP_Widget::__construct( ‘avia_portfoliomodelbox’, THEMENAME.’ Latest Models ‘, $widget_ops );
}
}
}
/*
* activate framework widgets
*/
if(!function_exists(‘bve_register_avia_widgets’) &&class_exists(‘avia_portfoliomodelbox’))
{
function bve_register_avia_widgets()
{
register_widget( ‘avia_portfoliomodelbox’ );
}
bve_register_avia_widgets(); //call the function immediatly to activate
}
Hey eaonflux,
Try including the preceding code too:
class avia_newsbox extends WP_Widget {
...
}
Best regards,
Josue