• Hi,

    I am implementing wordpress on a site, and I have been using Magic Fields which has been working great so far.

    I have hit a problem though. On all other pages for the secondary menu, I have used some code on the page to display the child pages for the page, pull information from each childs title and featured image.

    Now I would like to do this on the pages that use magic fields but its not working.

    The magic fields pages are using a custom post type called products.

    Below is the code I’ve been using which works fine on the other pages but not the custom post type. I put this code in my functions.php and call it on the page.

    // shows the current pages children
    function list_work_pages() {
    // Find Current Pages ID
    global $wp_query;
    $thePostID = $wp_query->post->ID;
    echo $thePostID;
    
    // Show children for current pages ID
    $args = array('showposts' => 100, 'post_parent' => $thePostID, 'post_type' => 'page',  'order' => 'ASC');
    
    // The Query
    query_posts( $args );
    
    echo '<div>';
    // The Loop
    while ( have_posts() ) : the_post();
    	echo '<ul id="work_wrap">';
    	echo '<li>';
    	echo '<a href="';
    	the_permalink();
    	echo '" title="';
    	echo '<div>';
    	//show featured page image
    	the_post_thumbnail( 'single-post-thumbnail' );
    	echo '</div>';
    	echo '<div>';
    	the_title();
    	echo '">';
    	the_title();
    	echo '</div>';
    	echo '</a>';
    	echo '</li>';
    	echo '</ul>';
    endwhile;
    echo '</div>';
    // Reset Query
    wp_reset_query();}

    Would love some help on this one as I’ve reached my knowledge limit.

  • The topic ‘Pulling information from magic fields custom post type’ is closed to new replies.