WordPress.org

Ready to get started?Download WordPress

Forums

how to include content of one page in another one ? (from title) (2 posts)

  1. paqui
    Member
    Posted 8 months ago #

    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

  2. alchymyth
    The Sweeper & Moderator
    Posted 8 months ago #

Reply

You must log in to post.

About this Topic