Hi again jutin.
Now the following error moved a line:
Catchable fatal error: Object of class WP_Error could not be converted to string in /kokkekniven.com/wp-content/themes/leviathan/functions.php on line 144
this is the whole functions.php from leviathan:
<?php
/**
* This is your child theme's functions.php file.
* You should make edits and add additional code above this point.
* Only change the functions below if you know what you're doing.
*/
/********************************************************/
/**
* For localization
*/
load_theme_textdomain( 'leviathan', get_stylesheet_directory() );
/**
* Add theme-specific actions
*/
add_action( 'hybrid_head', 'leviathan_remove_actions' );
add_action( 'hybrid_after_header', 'hybrid_breadcrumb', 11 );
add_action( 'hybrid_after_single', 'leviathan_author_box' );
/**
* Add theme-specific filters
*/
add_filter( 'wp_page_menu_args', 'leviathan_page_menu_args' );
add_filter( 'wp_page_menu', 'leviathan_subscribe' );
/**
* Remove actions from the parent theme
* Removes breadcrumb (placed elsewhere)
* Removes Secondary widgets (placed elsewhere)
*
* @since 0.1
*/
function leviathan_remove_actions() {
remove_action( 'hybrid_before_content', 'hybrid_breadcrumb' );
}
/**
* Page menu
* Add/remove arguments for your page menu
*
* @since 0.1.2
*/
function leviathan_page_menu_args( $args ) {
$args['depth'] = 4;
return $args;
}
/**
* Adds a feed link to the page navigation
*
* @since 0.1
*/
function leviathan_subscribe( $menu ) {
$feed = '<li class="feed-url"><a href="' . get_bloginfo( 'rss2_url' ) . '" title="' . __('Subscribe to the feed', 'leviathan') . '">' . __('Subscribe', 'leviathan') . '</a></li>';
$menu = str_replace( '</ul></div>', $feed . '</ul></div>', $menu );
return $menu;
}
add_filter('wp_page_menu', 'custom_page_nav');
function custom_page_nav($menu) {
$menu = false;
$menu = '<div id="page-nav"><ul>';
$menu .= '<li><a href="http://www.kokkekniven.com" title="Example">Forsiden</a></li>';
$menu .= wp_list_pages('title_li=&depth=3&echo=0&include=133,90,60,495,2,154');
$menu .= '</ul></div>';
return $menu;
}
/**
* Shows an author description after the post
* Only shows on single post
*
* @since 0.1
*/
function leviathan_author_box() {
global $hybrid_settings;
?>
<!--<div class="author-profile vcard">
<?php echo get_avatar( get_the_author_email(), '96', $hybrid_settings['default_avatar'] ); ?>
<h4 class="author-name fn n"><?php the_author_posts_link(); ?></h4>
<p class="author-description author-bio">
<?php the_author_description(); ?>
</p>
</div>-->
<?php
}
add_action( 'init', 'create_my_custom_tabs' );
function create_my_custom_tabs() {
register_hybrid_tab( 'custom_1', array( 'label' => 'Nyhedsbrev', 'callback' => 'nyhedsbrev_function' ) );
register_hybrid_tab( 'basketball', array( 'label' => 'Twitter', 'callback' => 'twitter_scores' ) );
}
function nyhedsbrev_function() {
echo '<form action="http://www.kokkekniven.com/nyhedsbrev/" method="post">
<h3>Kokkeknivens Nyhedsbrev</h3>
<p>Nyhedsbrevet indeholder opskrifter, nyttige links, tips og nyheder fra og om Kokkekniven.com</p>
<p>Nyhedsbrevet udsendes ca. 2-6 gange årligt og er 100% spamfrit.</p>
<p>
<label>Dit navn:</label><br />
<input type="text" name="nn" /></p>
<p>
<label>Din email:</label><br />
<input type="text" name="ne" /></p>
<p><input type="submit" class="button" value="Tilmeld" /></p>
<p><input type="hidden" name="na" value="s" /></p>
</form>';
}
function twitter_scores() { ?>
<a href="https://twitter.com/madopskrifter"><img src="http://www.kokkekniven.com/wp-content/uploads/twitter.png" alt="Madopskrifter på twitter" title="Madopskrifter på Twitter" /></a>
<a href="http://www.kokkekniven.com/feed/"><img src="http://www.kokkekniven.com/wp-content/uploads/fees.png" alt="Opskrifter Rss for kokkekniven" title="Opskrifter Rss for Kokkekniven" /></a>
<?php }
?>
<?php
add_filter( 'wp_title', 'my_title', 11 );
function my_title( $title ) {
if ( !is_home() )
$title .= ': ' . get_bloginfo( 'name' );
return $title;
}
?>
<?php
add_action( 'hybrid_after_entry', 'my_extra_metadata' );
function my_extra_metadata() {
global $post;
if ( !is_single() )
return false;
if ( in_category( '1' ) || has_tag( '3' ) ) {
echo '<div class="tagsleft">';
echo get_the_term_list( $post->ID, 'ingredienser', '<strong>Ingredienser:</strong><p> ', ', ', '</p>' );
echo get_the_term_list( $post->ID, 'type', '<strong>Type ret:</strong><p> ', ', ', '</p>' );
echo '</div>';
echo '<div class="tagsright">';
echo get_the_term_list( $post->ID, 'oprindelse', '<strong>Oprindelse:</strong><p> ', ', ', '</p>' );
echo get_the_term_list( $post->ID, 'season', '<strong>Sæson:</strong><p> ', ', ', '</p>' );
echo '</div>';
echo '<strong>Giv opskriften en karakter</strong>';
if ( function_exists( 'the_ratings' ) )
the_ratings();
echo '</div>';
}
}?>