audio player for embed audio in post

Posted in: Newspaper
Post count: 18

Is there any way to display audio player which is embed in post in get_excerpt()? Right now it is just displaying as [audio mp3=url.mp3"][/audio] in front end.

Post count: 18

I tried using both advanced excerpt plugin and adding add_filter(‘the_excerpt’, ‘do_shortcode’); in fucntions.php but didn’t work. In full post there is no problem in displaying audio player.

Post count: 22421

Hello,

The get_excerpt function in our theme was built to not render shortcodes. It was intentionally created not to do the functionality you are looking for. You will not be able to make it render any shortcodes except by altering the main function found here:
https://www.screencast.com/t/CaQS2aRUE0hR

Thank you!

Post count: 18

I don’t want to change the get_excerpt function. I am thinking to add new one.

function get_content() {
return $this->post->post_content;
}

Is this suppose to return the whole content? It is displaying excerpt only.

Post count: 22421

If you want to use a custom excerpt, why not use the excerpt field of wordpress? https://forum.tagdiv.com/excerpts-introduction/
The get_content code should return all the post content but it depends how the function is used and where. https://www.screencast.com/t/GKUGCaf4

Thank you!

Post count: 18

function get_content() {
return $this->post->post_content;
}

yes i was calling get_content in td_module_1.php

<div class=”td-excerpt”>
<?php echo $this->get_content(); ?>
</div>
But still it removes shortcode(audio shortcode). I don’t want to display excerpt. I want to display whole content of a post with audio player. does $this->post->post_content; also strip shortcode?

Thank you

Post count: 22421

Unfortunately you will not be able to do that on pages. Sorry. The get_content is still an ‘excerpt’ in it’s own. It is not the exact post content for it to be able to render shortcodes. You will need customization services for this and we cannot provide theme unfortunately. You can hire a freelancer/developer from studio.envato.com if you need custom work.

Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.