WordPress.org

Ready to get started?Download WordPress

Forums

get_post_meta (4 posts)

  1. crp2100
    Member
    Posted 1 year ago #

    I am a web designer but I am pretty much brand new to WordPress. I got this code sniplet from a lynda tut and it works well other than it lists back all pages instead of just the child pages of the current page. I hope this makes sense and someone can help.

    I am trying to only draw back the immediate children of the list, not the parents or the next set of children

    query_posts("posts_per_page=-1&post_type=page&post_parent=$pieces[1]");
    while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink(); ?>"
    class="product-jump" title="<?php echo get_post_meta($post->ID, "product_price", true); ?>"
    data-large="<?php get_post_meta($post->ID, "product_image", true); ?>">
    <span class="product-title">
    <?php the_title(); ?>
    <span class="product-code">
    <?php echo get_post_meta($post->ID, "product_code", true); ?><span></a>
  2. crp2100
    Member
    Posted 1 year ago #

    was I clear about what I needed? any help is appreciated or if theres an easy plugin to do this please let me know

    Thank you

  3. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    This sentence may have slowed down the community response:

    I am a web designer but I am pretty much brand new to WordPress

    Take some time as a web designer to read though the Codex.

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    just the child pages of the current page

    how is this array element defined before your code:

    $pieces[1] ?

    possibly try to use $post->ID instead.

    check: http://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters

Topic Closed

This topic has been closed to new replies.

About this Topic