Jump to content

Help for merging php code (easy)


nican

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.