How can Show Half or some of WordPress Content in Homepage Post

Hi i has the audio post format my post contain the audio embed code format and in homepage show me the audio player and the text description as you can see in image below.
enter image description here

i used the the_content(); function to show the whole content. how i can modify the the_content(); function until show me only the audio players and not show me the text description.

Read More

for information i used this code below to modify the content field until only show the audio players in my home page the code it is work but only show the audio link and don’t show me the audio such as audio player.

$first_audio = '';
$output = preg_match_all('/http://.*/(.*).(mp3|m4a|ogg)/',    get_post_field('post_content', $first_audio), $matches);
$first_audio = $matches[0][0];
echo '<br />';
echo $first_audio;

Related posts

Leave a Reply

1 comment

  1. I modified this function below to use or get the word numbers form excerpt or from content

    function words_limit($string, $word_limit) {
        $words = explode(' ', $string, ($word_limit + 1));
        if(count($words) > $word_limit)
            array_pop($words);
        return implode(' ', $words);
    }
    
    // use : words_limit(get_the_excerpt(), 200);
    // use : words_limit(get_the_content(), 200);