Jump to content
nican

Help for merging php code (easy)

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!

 

 

Share this post


Link to post
Share on other sites

Thank you,

but even this is beyond my understanding. I guess I need a suggestion with the resulting code here

Share this post


Link to post
Share on other sites

Why not just trying something first?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

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.