WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] One Child to Two Parents... Seems Like a Divorce, With Custody Issues (7 posts)

  1. mumptastic
    Member
    Posted 3 years ago #

    I know it is not possible to have two parents to one child, but is there a way to get this information out onto another page?

    ===================

    Baseball
    -Baseballs <--Repeat this on another page.
    -Bats

    Balls
    -Basketballs
    -Baseballs <--same as the content above.

    ===================

    If anyone has an answer it would be much appreciated!

  2. Matt McInvale
    Member
    Posted 3 years ago #

    I would probably do something with a shortcode to duplicate the page content onto the secondary page.

    Baseball > Baseballs would hold your content, then on Balls > Baseballs you'd add something like [mypageshortcode page=XX]

    I'm not aware of a shortcode that does that but it would be pretty easy to code up.

  3. mumptastic
    Member
    Posted 3 years ago #

    I fixed it with a loop!

  4. gl
    Member
    Posted 3 years ago #

    mumptastic, could you tell us the loop you fixed the problem with? Thanks!

  5. mumptastic
    Member
    Posted 3 years ago #

    <?php if ( (is_page('Baseballs')) or (is_page('All Balls'))){ ?>
    <ul class="products_page">
    <div class="title"><h1>Baseballs</h1></div>
       <?php
        query_posts(array('showposts' => 100, 'post_parent' => 97, 'post_type' => 'page', 'orderby' => 'title', 'order' => 'asc'));
    		while (have_posts()){
    			the_post(); //VITAL
    			$product = get_post_meta($post->ID, 'Product_thumb', true);
    
    		if ($product == ""){
    	$product = "http://site.com/IMG/coming_soon.png";
    			}
    			?>
                <li>
    
                <a href="<?php the_permalink() ?> class="grid-product">
                <img src="<?php echo $product ?>" title="<?php echo the_title() ?>"/>
    
    <div class="product_title"><?php the_title(); ?></div><br />
    	    </a>
    
                </li>
                <?php }
    	    wp_reset_query();
    	 ?>
    </ul>
    <?php } ?>
  6. mumptastic
    Member
    Posted 3 years ago #

    @gl Sorry it took me a day to get you the code. I am sure I could have used a more simple solution, but this did the trick for me.

  7. gl
    Member
    Posted 3 years ago #

    Thank you, mumptastic, that was very nice.

Topic Closed

This topic has been closed to new replies.

About this Topic