• Hello!

    I use wp_oembed_get function to display video from single URL.

    I don’t know what I’m doing wrong, everything seems right.
    Here is the code I’m using in content.php:

    //video title
    <?php echo '<h2>' . get_post_meta($post->ID, 'item_10_title', true) . '</h2>'; ?>
    
    //embeded video
    
    <?php
    $videourl = get_post_meta($post->ID, 'item_10_video', true);
    $htmlcode = wp_oembed_get($videourl);
    echo $htmlcode;
    ?>
    
    //video description
    <?php echo '<p>' . get_post_meta($post->ID, 'item_10_description', true) . '</p>'; ?>

    and the same code for next 9 videos…

    The thing is, when there’s only one video displayed via custom field, everything is fine, but when I add more videos, page slows down even more.
    When there are 10 videos displayed, I have about 3 seconds long server response which is really bad.

    When there are no videos added, only video title and description – page loads super fast. I know that the problem is with oEmbed.

    Please help. :/

The topic ‘Long server response using wp_oembed_get for custom metas!’ is closed to new replies.