Results 1 to 1 of 1
-
18th Nov 2012, 04:34 AM #1OPMember
yoo theme help
hi friends i use wordpress but when in active yoo theme its show error but i don't know about this error please help
error show
Code:Warning: Invalid argument supplied for foreach() in /public_html/wp-content/themes/yoo_catalyst/warp/systems/wordpress.3.0/helpers/widgets.php on line 107
PHP Code:<?php
/**
* @package Warp Theme Framework
* @author YOOtheme http://www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license YOOtheme Proprietary Use License (http://www.yootheme.com/license)
*/
/*
Class: WidgetsWarpHelper
Wordpress widget helper class, provides simplyfied access to wordpress widgets
*/
class WidgetsWarpHelper extends WarpHelper {
/* widgets */
public $widgets;
/* options */
public $options;
/*
Function: Constructor
Class Constructor.
*/
public function __construct() {
parent::__construct();
// set options
$this->options = get_option('warp_widget_options', array());
}
/*
Function: get
Retrieve a widget by id
Parameters:
$id - Widget ID
Returns:
Object
*/
public function get($id) {
global $wp_registered_widgets;
$widget = null;
if (isset($wp_registered_widgets[$id]) && ($data = $wp_registered_widgets[$id])) {
$widget = new stdClass();
foreach (array('id', 'name', 'classname', 'description') as $var) {
$widget->$var = isset($data[$var]) ? $data[$var] : null;
}
if (isset($data['callback']) && is_array($data['callback']) && ($object = current($data['callback']))) {
if (is_a($object, 'WP_Widget')) {
$widget->type = $object->id_base;
if (isset($data['params'][0]['number'])) {
$number = $data['params'][0]['number'];
$params = get_option($object->option_name);
if (false === $params && isset($object->alt_option_name)) {
$params = get_option($object->alt_option_name);
}
if (isset($params[$number])) {
$widget->params = $params[$number];
}
}
}
} else if ($id == 'nav_menu-0') {
$widget->type = 'nav_menu';
}
if (empty($widget->name)) {
$widget->name = ucfirst($widget->type);
}
if (empty($widget->params)) {
$widget->params = array();
}
$widget->options = isset($this->options[$id]) ? $this->options[$id] : array();
$widget->display = $this->_display($widget);
}
return $widget;
}
/*
Function: getWidgets
Retrieve widgets
Parameters:
$position - Position
Returns:
Array
*/
public function getWidgets($position = null) {
if (empty($this->widgets)) {
foreach (wp_get_sidebars_widgets() as $pos => $ids) {
$this->widgets[$pos] = array();
foreach ($ids as $id) {
$this->widgets[$pos][$id] = $this->get($id);
}
}
}
if (!is_null($position)) {
return isset($this->widgets[$position]) ? $this->widgets[$position] : array();
}
return $this->widgets;
}
/*
Function: _display
Checks if a widget should be displayed
Returns:
Boolean
*/
protected function _display($widget) {
if (!isset($widget->options['display']) || in_array('*', $widget->options['display'])) return true;
$query = $this['system']->getQuery();
foreach ($query as $q) {
if (in_array($q, $widget->options['display'])) {
switch($q) {
case "page":
if(is_home()) {
return in_array('home', $widget->options['display']);
}
if(is_front_page()) {
return in_array('front_page', $widget->options['display']);
}
default:
return true;
}
}
}
return false;
}
}Black Tiger Reviewed by Black Tiger on . yoo theme help hi friends i use wordpress but when in active yoo theme its show error but i don't know about this error please help error show Warning: Invalid argument supplied for foreach() in /public_html/wp-content/themes/yoo_catalyst/warp/systems/wordpress.3.0/helpers/widgets.php on line 107 code <?php /** * @package Warp Theme Framework * @author YOOtheme http://www.yootheme.com * @copyright Copyright (C) YOOtheme GmbH Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
[Selling] WP Theme - RedStar [Movie theme] coded | Unique
By ixtra in forum Completed TransactionsReplies: 0Last Post: 15th Dec 2011, 05:22 PM -
Need a mybb expert theme coder for a theme modification job.
By gfxguru in forum Web Development AreaReplies: 6Last Post: 24th Nov 2011, 05:14 PM -
[Selling] Ultimate Tube, best WP tube theme with 5 color styles in 1 theme
By lonerunner in forum Completed TransactionsReplies: 3Last Post: 29th Oct 2011, 12:16 AM -
need a coder to convert IPS theme to vB 4 theme
By Nitish in forum Web Development AreaReplies: 10Last Post: 17th Jul 2011, 05:50 PM -
[Buying] Wordpress Theme/ Datalife Engine Theme
By Prince of Wales in forum Completed TransactionsReplies: 0Last Post: 13th Jun 2011, 02:39 PM
themaManager - edit and manage...
Version 4.05 released. Open older version (or...