martt_1er
Member
Posted 1 year ago #
Hello
I want to insert the content of a page in my wordpress homepage (it's a special static homepage).
I made this hack :
$pages = get_pages();
foreach ($pages as $pagg) {
if( $pagg->post_title == "Sound" ){
$page_id = $pagg->ID;
$page_data = get_page( $page_id );
echo $page_data->post_content;
}
}
It gives me the raw content, unformated. I'm using dewplayer in the "Sound" page, and it ouputs "[dewplayer:http://cheebazz.com/mysoundfolder/myfile.mp3]" (as I save it in the page) instead of the flash control.
Is there a solution to display the page as it should be displayed ?
<?php
$slug = 'sound';
$args=array(
'name'=> $slug,
'post_type' => 'page',
'post_status' => 'publish',
'posts_per_page' => 1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
the_content();
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
martt_1er
Member
Posted 1 year ago #
Waw !
Perfect !
Now I just have to understand that piece of code and that's ok.
Thanks