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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • 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.