Closed Neomr closed 11 years ago
Hi Neomr,
/homepages/14/d13377013/htdocs/projekt/biz/klienten/axelfink/wp-content/themes/Minimalism-WordPress-Theme-master/administration/admin-functions.php on line 103
Error message indicates the error is in your theme, on line 103.
Please use the support forums (or the plug-in repository support forums) for this though, as it doesn't appear to be a bug with Event Organiser.
If you're not the developer of the theme, then I'd recommending speaking to them too about this error.
Hi there,
First kudos to you for this awesome theme. But I have an issue with event organiser and my theme. Below you'll find the error message:
Catchable fatal error: Object of class WP_Error could not be converted to string in /homepages/14/d13377013/htdocs/projekt/biz/klienten/axelfink/wp-content/themes/Minimalism-WordPress-Theme-master/administration/admin-functions.php on line 103
I've attached the admin-functions in a text document.
Thanks in advance for your help and support!
Marcus
<?php
/----------------------------------------------------------------------------/ /* Revolution-Themes Framework / / Custom Functions and Custom Post Options / /----------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
1.0 - Apple-like Breadcrumbs => revothemes_breadcrumbs() 2.0 - Custom CSS Output => revothemes_custom_css_output() 3.0 - Custom RSS Feed Output => revothemes_rss() 4.0 - Remove unnecessary parts from wp_head()
5.0 - Custom Favicon Output => revothemes_custom_favicon()
6.0 - Stylesheets Reader & Stylesheet Output
7.0 - Show analytics code in footer => revothemes_show_analytics() 8.0 - Output CSS from standarized options => revothemes_custom_css() 9.0 - Get big Images for Slider => revothemes_wpmu() 10.0 - Pagination => revothemes_paginate() 11.0 - revothemes_custom_background() 12.0 - SEO for split comments into multiple pages => revothemes_canonical_for_comments() 13.0 - Get first image from a spezific post => revothemes_get_first_image() 14.0 - Security => remove_comment_author_class() 15.0 - Building the Recent Comments => revothemes_recent_comments() 16.0 - Output post thumbnails => revothemes_the_post_thumbnails() 17.0 - Output post thumbnail URL => revothemes_post_thumbURL() 18.0 - Gallery Shortcode Output => revothemes_gallery() 19.0 - Share this buttons, Twitter, Facebook, Google+ => revothemes_share_this() 20.0 - Manage WordPress contact fields 21.0 - Post-thumbnails for feeds => revothemes_post_thumbnail_feeds() 22.0 - Custom CSS Output => Revothemes Shortcodes CSS => revothemes_custom_shortcode_css_output() 23.0 - Remove Magic Quotes => get rid of unnecessary backslashes 24.0 - Canonical Permalink => canonical_request() 25.0 - Supreme Google Webfonts
-----------------------------------------------------------------------------*/
// 1.0 ========== Apple-like Breadcrumbs, if Yoast Breadcrumbs is not installed.
/\ HTML - Output:
function revothemes_breadcrumbs() { $name = __('Back Home'); // Text for the Home Icon, only visible in html source code $delimiter = ' '; // No need, is added by CSS $currentBefore = '
if ( !is_home() && !is_front_page() || is_paged() ) {
if ( is_category() ) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' ')); echo $currentBefore . ''; single_cat_title(); echo '' . $currentAfter;
elseif ( is_day() ) { echo '
elseif ( is_month() ) { echo '
elseif ( is_year() ) { echo $currentBefore . get_the_time('Y') . $currentAfter;
elseif ( is_single() && !is_attachment() ) { $cat = get_the_category(); $cat = $cat[0]; echo '
elseif ( is_attachment() ) { $cat = get_the_category(); $cat = (isset($cat[0])); echo $currentBefore; the_title(); echo $currentAfter;
elseif ( is_page() && !$post->post_parent ) { echo $currentBefore; the_title(); echo $currentAfter;
elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = '
elseif ( is_search() ) { echo $currentBefore . __('Search results for '', 'revothemes') . get_search_query() . ''' . $currentAfter;
elseif ( is_tag() ) { echo $currentBefore . __('Posts tagged '', 'revothemes'); single_tag_title(); echo ''' . $currentAfter;
elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $currentBefore . __('Articles posted by ', 'revothemes') . $userdata->display_name . $currentAfter;
elseif ( is_404() ) { echo $currentBefore . __('Error 404', 'revothemes') . $currentAfter; }
if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' ('; echo $currentBefore . __('Page') . ' ' . get_query_var('paged') . $currentAfter ; if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')'; } } }
// 2.0 ========== Custom CSS Output => Custom Stylesheet =======================
// Output custom.css - custom stylesheet if (!function_exists( 'revothemes_custom_css_output')) { function revothemes_custom_css_output() {
// Custom.css insert echo "\n"; echo ''."\n"; } } add_action('wp_head', 'revothemes_custom_css_output');
// 3.0 ========== Custom RSS Feed Output =======================================
function revothemes_custom_feed() { global $data; if ($data['rss_feed'] != '') { echo "\n"; echo ''."\n"; } else { ?>
<?php } } add_action('wp_head', 'revothemes_custom_feed');
// 4.0 ========== Remove unnecessary parts from wp_head() ======================
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file. remove_action( 'wp_head', 'index_rel_link' ); // index link remove_action( 'wp_head', 'parent_post_rel_link',10, 0 ); // prev link remove_action( 'wp_head', 'start_post_rel_link',10, 0 ); // start link remove_action( 'wp_head', 'adjacent_posts_rel_link',10, 0); // Display relational links for the posts adjacent to the current post. remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); //Display shortlink
// 5.0 ========== Custom Favicon Output => revothemes_custom_favicon() =========
function revothemes_custom_favicon() { global $data; if ($data['custom_favicon'] != '') { echo "\n"; echo ''."\n"; } else { ?>
<?php } }
add_action('wp_head', 'revothemes_custom_favicon');
// 6.0 ========== Stylesheets Reader =======================
define('STYLES_PATH', STYLESHEETPATH . '/styles/'); define('STYLES', get_bloginfo('stylesheet_directory') . '/styles/'); //define('LAYOUTS', get_bloginfo('stylesheet_directory') . '/layouts/');
$alt_stylesheet_path = STYLES_PATH; $alt_stylesheets = array();
if ( is_dir($alt_stylesheet_path) ) { if ($alt_stylesheet_dir = opendir($alt_stylesheet_path) ) { while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) { if(stristr($alt_stylesheet_file, ".css") !== false) { $alt_stylesheets[] = $alt_stylesheet_file; } } } }
// 7.0 ========== Show analytics code in footer => revothemes_show_analytics()
function revothemes_show_analytics() { global $data; $output = $data['google_analytics']; if ( $output <> "" ) echo stripslashes($output) . "\n"; } add_action('wp_footer','revothemes_show_analytics');
/-----------------------------------------------------------------------------------/ /* 8.0 - Output CSS from standarized options / /-----------------------------------------------------------------------------------*/
function revothemes_custom_css() { global $data; $output = ''; $custom_css = $data['revothemes_custom_css'];
} add_action('wp_head', 'revothemes_custom_css');
// 9.0 ========== Get big Images for Slider => revothemes_wpmu() ==============
function revothemes_wpmu ($img) { global $blog_id; $imageParts = explode('/files/', $img); if (isset($imageParts[1])) { $img = '/blogs.dir/' . $blog_id . '/files/' . $imageParts[1]; } return($img); }
function catch_that_image ($post_id=0, $width=60, $height=60, $img_script='') { global $wpdb; if($post_id > 0) {
}
// 10.0 ========== Pagination => revothemes_paginate() =========================
/**
@return string HTML content, if not displaying. */ function revothemes_paginate($args = null) { $defaults = array( 'page' => null, 'pages' => null, 'range' => 3, 'gap' => 3, 'anchor' => 1, 'before' => '
$r = wp_parse_args($args, $defaults); extract($r, EXTR_SKIP);
if (!$page && !$pages) { global $wp_query;
}
$output = ""; if ($pages > 1) { $output .= "$before$title"; $ellipsis = "...";
}
if ($echo) { echo $output; }
return $output; }
/**
// 11.0 ========== revothemes_custom_background() ==============================
function revothemes_custom_background() {
$output = '';
if ($output <> '') { $output = "\n<style type=\"text/css\">\n body {" . $output . "}\n"; echo $output; } }
add_action('wp_head', 'revothemes_custom_background');
// 12.0 ========== SEO for split comments into multiple pages ==================
function revothemes_canonical_for_comments() { global $cpage, $post; if ( $cpage > 1 ) : echo "\n"; echo "\n"; endif; }
add_action( 'wp_head', 'revothemes_canonical_for_comments' );
// 13.0 ========== Get first image from a spezific post ========================
function revothemes_get_first_image() { global $post, $posts; $first_img = ''; $output = preg_match_all('/<img.+src=\'"[\'"].*>/i', $post->post_content, $matches); if(isset($matches[1][0])){ $first_img = $matches [1][0]; return $first_img; } }
// 14.0 ========== Security => remove_comment_author_class() ===================
// Security: Hide Usernames from Classes function remove_comment_author_class( $classes ) { foreach( $classes as $key => $class ) { if(strstr($class, "comment-author-")) { unset( $classes[$key] ); } } return $classes; }
add_filter( 'comment_class' , 'remove_comment_author_class' );
// Security: Hide WordPress Version in Sourcecode Head remove_action('wp_head','wp_generator');
// 15.0 ========== Building the Recent Comments => revothemes_recent_comments()
/* Function for Revolution-Themes Sidebar Box Widget => revo-sidebar-box.php */
function revothemes_recent_comments($no_comments = 5, $comment_len = 50) { global $wpdb; $request = "SELECT * FROM $wpdb->comments"; $request .= " JOIN $wpdb->posts ON ID = comment_post_ID"; $request .= " WHERE comment_approved = '1' AND post_status = 'publish' AND post_password =''"; $request .= " ORDER BY comment_date DESC LIMIT $no_comments"; $comments = $wpdb->get_results($request); if ($comments) { foreach ($comments as $comment) { ob_start(); ?>
comment_content), 0, $comment_len)); ?>...
}
// Get author for comment function revothemes_get_author($comment) { $author = ""; if ( empty($comment->comment_author) ) $author = __('Anonymous', 'revothemes'); else $author = $comment->comment_author; return $author; }
// 16.0 ========== revothemes_the_post_thumbnails() ============================
function revothemes_the_post_thumbnails() {
if(has_post_thumbnail()) { $thumb = revothemes_post_thumbURL(); echo '
}
/* This is only for the magazine-templates */ function revothemes_magazine_thumbnails() {
if(has_post_thumbnail()) { $thumb = revothemes_post_thumbURL(); echo '
}
function revothemes_magazine_bigthumb() {
if(has_post_thumbnail()) { $thumb = revothemes_post_thumbURL(); echo '
}
// 17.0 ========== revothemes_post_thumbURL() ==================================
function revothemes_post_thumbURL() { global $post, $posts; $thumbnail = ''; ob_start();the_post_thumbnail(180,180,true);$toparse=ob_get_contents();ob_end_clean(); preg_match_all('/src=("[^"]*")/i', $toparse, $img_src); $thumbnail = str_replace("\"", "", $img_src[1][0]); return $thumbnail; }
function the_excerpt_max_charlength($charlength) { $excerpt = get_the_excerpt(); $charlength++; if(strlen($excerpt)>$charlength) { $subex = substr($excerpt,0,$charlength-5); $exwords = explode(" ",$subex); $excut = -(strlen($exwords[count($exwords)-1])); if($excut<0) { echo substr($subex,0,$excut); } else { echo $subex; } echo "[...]"; } else { echo $excerpt; } }
// 18.0 ========== Gallery Shortcode Output ====================================
// See: http://snipplr.com/view/27051/wordpress-27-gallery-styles-fix/
function revothemes_gallery($attr) { global $post;
}
// 19.0 ========== Share this buttons, Twitter, Facebook, Google+ ==============
function revothemes_share_this(){
} //add_action('the_content', 'revothemes_share_this');
function revothemes_share_scripts() { ?>
<?php }
add_action('wp_footer', 'revothemes_share_scripts');
// 20.0 ========== Manage WordPress contact fields ============================= /**
$TTT_Contactfields = new TTT_Contactfields( array ( 'Twitter' , 'Facebook' , 'Xing' , 'Country' , 'City' , 'Latitude' , 'Longitude' ) );
$TTT_Contactfields = new TTT_Contactfields( array ( 'Twitter' , 'Facebook' , 'Google+' , 'Country' , 'City' , 'Latitude' , 'Longitude' ) );
class TTT_Contactfields { public $new_fields , $active_fields , $replace ;
}
// 21.0 ========== Post-thumbnails for feeds => revothemes_post_thumbnail_feeds()
function revothemes_post_thumbnail_feeds($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '
// 22.0 ========== Custom CSS Output => Revothemes Shortcodes CSS =======================
// Output custom.css - shortcode stylesheet if (!function_exists( 'revothemes_custom_shortcode_css_output')) { function revothemes_custom_shortcode_css_output() {
// Custom.css insert echo "\n"; echo ''."\n"; } } add_action('wp_head', 'revothemes_custom_shortcode_css_output');
// 23.0 ========== Remove Magic Quotes =======================================//
/ Plugin Name: Remove Magic Quotes Plugin URI: http://toscho.de/2009/php-magic-quotes-entfernen/ Description: Entfernt Backslashes, die von dummen PHP-Einstellungen eingebaut werden. Version: 0.1 Author: Thomas Scholz Author URI: http://toscho.de / RMQ::gpc_strip_slashes();
class RMQ { static function gpc_strip_slashes() { if ( get_magic_quotes_gpc() ) { $_REQUEST = RMQ::array_map_recursive('stripslashes', $_REQUEST); $_GET = RMQ::array_map_recursive('stripslashes', $_GET); $_POST = RMQ::array_map_recursive('stripslashes', $_POST); $_COOKIE = RMQ::array_map_recursive('stripslashes', $_COOKIE); }
}
// 24.0 ========== Canonical Permalink => canonical_request() ==================
/ Plugin Name: Canonical Permalink Plugin URI: http://toscho.de/2010/wordpress-plugin-canonical-permalink/ Description: Removes illegal numeric suffixes from the request URI. Version: 0.3 Author: Thomas Scholz Author URI: http://toscho.de Created: 04.04.2010 /
/**
@return void */ function canonical_request() { global $page, $post;
// post, page, attachment, preview if ( ! is_singular() or is_preview() ) { return; }
$permalink = get_permalink();
// We don't have access to the number of sub pages here. // So we have to hack. $max_pages = substr_count( $post->post_content, '') + 1;
if ( 1 < $page and $page <= $max_pages ) { / * Handle different permalink settings, eg: * /%year%/%postname%.html or * /%year%/%postname%/ / $rev_perma_struct = strrev(get_option('permalink_structure'));
}
$host_uri = 'http' . ( empty ( $_SERVER['HTTPS'] ) ? '' : 's' ) . '://' . $_SERVER['HTTP_HOST']; $canonical_path = str_replace($host_uri, '', $permalink);
if ( ! empty ( $_GET ) ) { global $wp; // Array $allowed = $wp->public_query_vars;
}
if ( $canonical_path == $_SERVER['REQUEST_URI'] ) { return; } // Debug current result:
print '
';// Change it or return 'false' to stop the redirect. $canonical_path = apply_filters( 'toscho_canonical_path', $canonical_path );
if ( FALSE != $canonical_path ) { header('Location: ' . $permalink, true, 301); die("$permalink"); }
return; } add_action('wp', 'canonical_request');
// 25.0 ========== Supreme Google Webfonts =====================================
/* Plugin Name: Supreme Google Webfonts Plugin URI: Description: Adds all 291 currently available Google webfonts into a nice dropdown list in your visual editor. Simply select your Google Webfont and apply it to your text. Also includes font size selection to apply to Google Webfonts. Author: Josh Lobe Version: 1.1 Author URI: http://joshlobe.com
*/
/* Copyright 2011 Josh Lobe (email : joshlobe@joshlobe.com)
*/
if ($data['googlewebfonts'] == 'No') { // Option to disable this plugin for better Site Performance.
add_action('admin_print_styles', 'add_josh_stylesheet'); add_action('wp_print_styles', 'add_josh_stylesheet');
}