Hi I am after adding some code to my home page but gotton a liitle confused as to how I am doing it
ok I am using graphene theme, and using yoast wordpress SEO plugin
and what I want to do on my home page is, when displaying posts check for the post meta description (for each the one post) and post it instead of the page content like it does now, the code below does just that, but it also still posts the post content?
<?php
$yoast_meta = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true);
if ( $yoast_meta ) {
echo "$yoast_meta";
} else {
echo "do_action('graphene_after_post_content')";
}
?>
can anyone help me do something like this =
if meta description is there, post it
else
if meta description is not there post 100 words of post content
==
but then both need to still post a continue reading button to the post, hope you understand what I mean? thanks
