无法在DK PDF转换器中显示自定义帖子类型

时间:2017-08-31 12:57:30

标签: php wordpress pdf

我正在使用wordpress处理页面,我安装了名为DK PDF的插件,该插件将页面转换为PDF,以便访问者可以下载或打印页面。我们遇到的问题是我们无法转换自定义帖子类型的列表。

这是我们的DK PDF模板代码,您可以在其中管理它显示的字段:

    <html>
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_url' ); ?>" media="all" />
        <?php 
            $wp_head = get_option( 'dkpdf_print_wp_head', '' );
            if( $wp_head == 'on' ) {
                wp_head();
            } 
        ?>
        <style type="text/css">
            body {
                background:#FFF;
                font-size: 100%;
            }
            <?php 
                $css = get_option( 'dkpdf_pdf_custom_css', '' );
                echo $css; 
            ?>          
        </style>
    </head>
    <body>
        <?php
        global $post;
        $pdf  = get_query_var( 'pdf' );
        $post_type = get_post_type( $pdf );
      $args = array(
        'p' => $pdf,
        'post_type' => $post_type,
        'post_status' => 'publish'
      );               
      $the_query = new WP_Query( apply_filters( 'dkpdf_query_args', $args ) );              
        if ( $the_query->have_posts() ) {             
          while ( $the_query->have_posts() ) {
              $the_query->the_post();
              global $post; ?>



        <h1> <?php      
              the_title(); ?></h1>

         <?php      
              the_title(); 
              the_post_thumbnail();
              the_content();

              **THE ERROR:**

              /* The field with the error */
              <?= $woning->listing('woning.inhoud'); ?>

        ?>






          <?php }
        }    
        wp_reset_postdata();
      ?>
    </body>
</html>

因此,您可以看到靠近底部的代码,这是我们收到错误的规则:

解析错误:语法错误,意外'&lt;'在第48行的C:\ xampp \ htdocs \ vermunt \ wp-content \ themes \ vermunt \ dkpdf \ dkpdf-index.php中。

所以我的问题是:你如何让这些自定义帖子类型显示在模板中?为代码提供某种构建或只重写行:)

我对此没有任何经验,所以可能是一些愚蠢的错误。

感谢提前帮助,

的Yannick

0 个答案:

没有答案