Php 使用来自自定义元的值预先结束fancybox

Php 使用来自自定义元的值预先结束fancybox,php,jquery,wordpress,Php,Jquery,Wordpress,我正在使用fancybox,需要预先添加一个链接,其中一部分是来自自定义元字段的值。目前我有一些东西看起来像这样: <script> $(".fancybox").fancybox({ openEffect : 'none', closeEffect : 'none', padding : [15, 15, 15, 15], helpers : { title : null

我正在使用fancybox,需要预先添加一个链接,其中一部分是来自自定义元字段的值。目前我有一些东西看起来像这样:

    <script>
      $(".fancybox").fancybox({
        openEffect  : 'none',
        closeEffect : 'none',
        padding : [15, 15, 15, 15],
        helpers : {
          title : null
        },
        'scrolling'   : 'no',
        beforeShow   : function() {
          if ($(this.element).hasClass('pdf')) {
            this.inner.prepend( '<a class="full-screen" href="http://www.example.com/wp-content/plugins/pdfjs-viewer-shortcode/web/viewer.php?file=<?php echo get_post_meta( $post->ID, '_wpb_arch', true ); ?>">View PDF Full Screen</a>' );
          }
        },
        iframe : {
          preload: false
        }
      });
    </script>
prepend工作正常,但无法使用get\u post\u meta检索值。 有人知道如何获取脚本来检索php变量吗?我对jquery和PHP还不太熟悉,所以我很紧张


非常感谢

非常粗鲁,但希望能有所帮助

捕获我的变量,但不使用jquery脚本

<?php $payment_fee = get_post_meta( $post->ID, 'payment_fee', true ); ?>
在我的查询的参数中使用该变量

<?php 
  $args = array(

    'post_type'        => 'payment',
    'post_status'      => 'publish',
    'meta_key' => 'payment_status',
    'meta_value' => 'visible',
    'suppress_filters' => true );


  // the query
  $the_query = new WP_Query( $args ); ?>

从那里我可以把它吐到我想要的地方

谢谢你看一看,让它旋转了一下,但它仍然无法显示。我想知道这是否是因为fancybox覆盖在posttype存档上使用了一系列非常复杂的循环来引入子页面。谢谢你的关注。