Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

paqui on "how to include content of one page in another one ? (from title)"

$
0
0

This code is used to include the contents of a page in another from the ID.

<?php
$args=array(
  'page_id' => 893,
  '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().
?>

I would like to do the same but from the title.

Thinks


Viewing all articles
Browse latest Browse all 8245

Trending Articles