1

下面你可以看到我的主页模板。我曾经在我的页面内容中有这一行,它加载缩略图和带有视频的视频播放器。我现在想在模板中使用它,但我不知道如何正确调用它。您可以看到我正在尝试从我的主题选项面板调用视频。

[KGVID poster="http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/thumbnail-home.jpg" width="1005" height="565"]http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/sample.mp4[/KGVID]

[KGVID poster="http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/thumbnail-home.jpg" width="1005" height="565"]http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/sample.mp4[/KGVID]

任何帮助将非常感激。

<?php /* Template Name: Home Page */ get_header(); ?>

    <!-- section -->
    <section role="main">

    <?php if (have_posts()): while (have_posts()) : the_post(); ?>

        <!-- article -->
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

            [KGVID poster="http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/thumbnail-home.jpg" width="1005" height="565"]<?php echo $smof_data['home-page-video-url'];?>[/KGVID]

        </article>
        <!-- /article -->

    <?php endwhile; ?>

    <?php else: ?>

        <!-- article -->
        <article>

            <h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2>

        </article>
        <!-- /article -->

    <?php endif; ?>

    </section>
    <!-- /section -->

<?php get_footer(); ?>
4

1 回答 1

2

要在模板中使用简码,请执行此操作

<?php echo do_shortcode("[KGVID poster='http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/thumbnail-home.jpg' width='1005"' height='565']http://www.muratgokmen.co.uk/wp-content/uploads/2013/09/sample.mp4[/KGVID]"); ?>
于 2013-09-10T16:33:30.303 回答