0

我试图在不改变当前模板的 css 属性的情况下调用页面 ID。

调用页面 ID 有效,但我相信它具有该模板的属性?随着产品图像 div 从页面上消失?!我目前拥有的代码如下。

PHP

  <div class="entry">

    <div class="product-list">
        <?php 
        $id=7; 
        $post = get_page($id); 
        $content = apply_filters('the_content', $post->post_content); 
        echo $content;  
        ?>
      </div>
      <div class="product-content">
        <?php the_content(); ?>
      </div> 

      <div class="product-image"><?php the_post_thumbnail();?></div>

    </div><!-- / .entry -->


</div>

在产品列表类中输入段落标签时,布局完美。

任何人都知道如何删除页面的完整样式,或者如果这不是问题,可能是什么?谢谢!

尝试过 - 但没有用

  <div class="entry">

    <div class="product-list">
        <?php 
                    $id=7; 
                    $post = get_page($id); 
                    //remove auto p filter
                    remove_filter ('the_content','wpautop');
                    $content = apply_filters('the_content', $post->post_content); 
                    //return the filter for other posts/pages down the road
                    add_filter ('the_content','wpautop');
                    echo $content;  
                    ?>
      </div>
      <div class="product-content">
        <?php the_content(); ?>
      </div> 

      <div class="product-image"><?php the_post_thumbnail();?></div>

    </div><!-- / .entry -->


</div>
4

0 回答 0