• Resolved martt_1er

    (@martt_1er)


    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:https://cheebazz.com/mysoundfolder/myfile.mp3%5D” (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 ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?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().
    ?>
    Thread Starter martt_1er

    (@martt_1er)

    Waw !
    Perfect !
    Now I just have to understand that piece of code and that’s ok.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Insert a formatted page in my home.’ is closed to new replies.