Php 调用页面ID时删除样式

Php 调用页面ID时删除样式,php,wordpress,css,Php,Wordpress,Css,我试图在不改变当前模板的css属性的情况下调用页面ID 调用页面ID是可行的,但我相信它具有该模板的属性?当产品图像div从页面上消失时?! 我目前掌握的代码如下 PHP 在product list类中输入段落标记时,布局可以完美地工作 有人知道如何删除页面的完整样式吗?如果不是这个问题,可能是什么问题?谢谢大家! 尝试过,但没有成功 <div class="entry"> <div class="product-list"> <

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

调用页面ID是可行的,但我相信它具有该模板的属性?当产品图像div从页面上消失时?! 我目前掌握的代码如下

PHP


在product list类中输入段落标记时,布局可以完美地工作

有人知道如何删除页面的完整样式吗?如果不是这个问题,可能是什么问题?谢谢大家!

尝试过,但没有成功

  <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>



我想你需要告知你使用的是什么cms,我想是wordpress吧?然后你可能需要添加“wordpress”标签,这样任何wordpress专家都可以找到你的问题。是的,是wordpress抱歉。我很难理解你的问题question@mark本质上,我试图创建一个子菜单,从不同的页面调用内容,并将其放入新模板中。名为“products”的页面在内容区域中有两个产品名称。然后,我使用如上所示的模板php代码为每个产品名创建了一个页面。我相信我可能需要以不同的方式查看,并尝试将“sub_menu”代码插入“project list”div。无论如何,感谢您的查找。这是新的page-name.php模板上的自定义代码吗?开始一个新的自定义页面模板可能比有条件地加载所有这些新内容更容易?
  <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>