Hi @bungeshea ,
here is the complete error message:
Undefined variable $post in xxxxx/wordpress/wp-content/plugins/code-snippets/php/snippet-ops.php(504) : eval()'d code on line 11
Attempt to read property "ID" on null in xxxxx/wordpress/wp-content/plugins/code-snippets/php/snippet-ops.php(504) : eval()'d code on line 11
I found the snippet that is causing the error – thanks to your help with the search function ??
But now I’m stuck, cause I don’t know how to repair the snippet code – would you mind helping me?
Here is the code:
// Add featured image to RSS feed
add_filter('the_excerpt_rss', 'j0e_imagetoRSS');
add_filter('the_content_feed', 'j0e_imagetoRSS');
function j0e_imagetoRSS($content)
{
$label = 'Tags: ';
if (has_post_thumbnail()) {
$content = '
' . get_the_post_thumbnail($post->ID, 'zuki-medium-portrait', array('style' => 'max-width: 100%; height: auto; margin-bottom: 10px;')) . '
' . $content .
'
' . $label . j0e_show_tags() . '';
}
return $content;
}
// Creates the tags list
function j0e_show_tags()
{
$post_tags = get_the_tags();
$separator = ' | ';
$output = '';
if (!empty($post_tags)) {
foreach ($post_tags as $tag) {
$output .= 'term_id)) . '">#' . $tag->name . '' . $separator;
}
}
return trim($output, $separator);
}
It is the line with the “$post->ID” in it.
That would be really really kind ??
Thanks
Heike
-
This reply was modified 1 year, 8 months ago by HighKay.