Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to include excerpt in ul from different pages with the same parent - Wordpress
    primarykey
    data
    text
    <p>I wish to get the title, the excerpt and some meta from three different pages that all have the same parent.</p> <p>I do not wish to specify wich three pages to show but rather show the three that was last edited/published. </p> <p>I aim to display the content as three blocks on a horizontal line.</p> <p>As I was unable to get the code to work:</p> <pre><code>&lt;ul id=""&gt; &lt;?php query_posts("posts_per_page=1&amp;post_type=page&amp;post_parent=4"); the_post(); ?&gt; &lt;li&gt; &lt;img src="&lt;?php echo get_post_meta($post-&gt;ID, "image", true); ?&gt;" alt="&lt;?php the_title(); ?&gt;" /&gt; &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt; &lt;?php the_excerpt(); ?&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <hr> <p>Thank you Dan, this still does not work though. The excrept of the first page does not show (the title shows and the meta also). Tried the code below with the same result except that the second time the content is displayed, the excerpt of the first page shows.</p> <pre><code>&lt;?php get_header(); the_post(); ?&gt; &lt;div id="main-content"&gt; &lt;?php $categoriesCF = get_post_meta($post-&gt;ID, "categories", true); $allCategories = explode(",", $categoriesCF); foreach ($allCategories as $category) { $pieces = explode("|", $category); $link = get_permalink($pieces[1]); echo "&lt;div class='product-group group'&gt;"; echo "&lt;h3&gt;&lt;a href='$link'&gt;" . $pieces[0] . "&lt;/a&gt;&lt;/h3&gt;"; query_posts("posts_per_page=-1&amp;post_type=page&amp;post_parent=$pieces[1]"); while (have_posts()) : the_post(); ?&gt; &lt;a href="&lt;?php the_permalink(); ?&gt;" class="product-jump" title="&lt;?php the_title(); ?&gt;" data-large="&lt;?php get_post_meta($post-&gt;ID, "image", true); ?&gt;"&gt; &lt;?php echo "&lt;img src='" . get_post_meta($post-&gt;ID, "image", true) . "' /&gt;"; ?&gt; &lt;span class="product-title"&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt; &lt;span class="product-title"&gt;&lt;?php the_excerpt(); ?&gt;&lt;/span&gt;&lt;/a&gt; &lt;?php endwhile; wp_reset_query(); echo "&lt;/div&gt;"; }; ?&gt; &lt;/div&gt; &lt;?php get_sidebar(); ?&gt; &lt;?php get_footer(); ?&gt;` </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload