nican Posted May 8, 2019 Share Posted May 8, 2019 Hello guys, I don't really know php but I am always been able to copy/paste it and move stuff around on my wordpress website until now. This last challenge is beyond my skills though (I am sure it will be trivial for you). So I have this code snippet to show a video duration <?php global $post; $video = cbc_get_video_data( $post ); if( $video ) { echo $video->get_human_duration(); } ?> And I have this code to show a post title if ($show_title) { $title_content .= apply_filters( 'uncode_before_body_title', '' ); $title_content .= '<div class="post-title-wrapper"><h1 class="post-title">' . get_the_title() . '</h1>'; $title_content .= uncode_post_info() . '</div>'; $title_content .= apply_filters( 'uncode_after_body_title', '' ); } I want to show the video duration right before the post title and in line with it, so inside the h1 tag. How to do that? Thanks for any help! Link to comment Share on other sites More sharing options...
chhorn Posted May 8, 2019 Share Posted May 8, 2019 Place the first code before the second, then use the function output for string concatanation https://www.php.net/manual/en/language.operators.string.php Link to comment Share on other sites More sharing options...
nican Posted May 9, 2019 Author Share Posted May 9, 2019 Thank you, but even this is beyond my understanding. I guess I need a suggestion with the resulting code here Link to comment Share on other sites More sharing options...
chhorn Posted May 9, 2019 Share Posted May 9, 2019 Why not just trying something first? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.