Quote:
Originally Posted by JosephFM
Thanks for the code CyberSEO!
BTW, the code above that you have to place on the "PHP code <?php .. ?>" box might not work for some, since it places all the content in the excerpt area, so if you are having trouble with that one, use the code below so that all the info from the feed gets placed in the post content area instead. I think it depends on the theme you use.
|
That's correct some themes use excerpt's some content, some use both. So I would suggest to modify the code like this:
Code:
$post['guid'] = $post['custom_fields']['embed_chat_url'];
$post['post_title'] = '' . $post['custom_fields']['display_name'];
if (!cseo_post_exists($post)) {
if (substr($post['custom_fields']['thumb'], 0, 2) == '//') {
$post['custom_fields']['thumb'] = 'http:' . $post['custom_fields']['thumb'];
}
$post['post_content'] = '<iframe src="' . $post['guid'] . '" width="850" height="380"></iframe>';
$post['post_content'] .= '<p style="text-align: center;"><b>Weight:</b> ' . $post['custom_fields']['weight'] . ', <b>height:</b> ' . $post['custom_fields']['height'] . '</p>';
$post['post_content'] .= '<p style="text-align: center;"><b>Ethnicity:</b> ' . $post['custom_fields']['ethnicity'] . ', <b>language:</b> ' . $post['custom_fields']['primary_language'] . '</p>';
$post['post_content'] .= '<p style="text-align: center;"><b>Turns on:</b> ' . $post['custom_fields']['turns_on'] . ', <b>turns off:</b> ' . $post['custom_fields']['turns_off'] . '</p>';
$post['post_excerpt'] = $post['post_content'];
unset($post['custom_fields']['embed_chat_url']);
unset($post['custom_fields']['display_name']);
unset($post['custom_fields']['turns_on']);
unset($post['custom_fields']['turns_off']);
unset($post['custom_fields']['primary_language']);
unset($post['custom_fields']['ethnicity']);
unset($post['custom_fields']['height']);
unset($post['custom_fields']['weight']);
} else {
$post = false;
}
So if your theme looks weird, just comment this line:
$post['post_excerpt'] = $post['post_content'];
In this case you will be sure that the code will be working on all themes. Also if you are using some old blog-style theme, you may want to disable the thumbnail generation - just skip step #5 in my instruction. In this case the code will be really 100% universal.