Saturday, 10 August 2013

Remove style when calling Page ID

Remove style when calling Page ID

I'm trying to call a page ID without it altering the css properties of the
current template.
Calling a Page ID works but I believe it takes on the properties of that
template? As the product-image div disappears off the page?! The code I
have at the moment is below.
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>
When entering a paragraph tag in the product-list class the layout works
perfectly.
Anyone have any idea on how to remove the complete style of the page or if
this is not the issue, what it could be? Thank you!
TRIED - but didn't work
<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>

No comments:

Post a Comment