• Resolved vajnabotond

    (@vajnabotond)


    I have this code:

    <?php
    			 $mypages = get_pages('child_of='.$wp_query->post->ID.'&sort_column=menu_order&sort_order=asc');
    			 $count = 0;
    			 foreach($mypages as $page)
    			 {
    			  $content = $page->post_content;
    			  if( $count % 2  == 0 ) $style="color white";
    			  else $style="color gray";
    			  $count++;
    			  $content = apply_filters('the_content', $content);
    			 ?>
    			 <div <?php post_class($style);?>>
    			 <a name="<?php echo get_page_link($page->ID) ?>">
    			 <div class= "contentpart">
    			<?php echo the_post_thumbnail('feat'); ?>
    			  <h1><a name="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h1>
    			  <div class="contentpart-text"><?php echo $content ?></div></div></div>
    			 <?php
    			 }
    			?>

    I also have in functions.php:

    if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'feat', 460, 9999 );
    }

    but the thumbnail images does not appear.

Viewing 1 replies (of 1 total)
  • Thread Starter vajnabotond

    (@vajnabotond)

    ok, i found the solution:

    <?php
    $args = array('post_parent' => $post->ID, 'post_type' => 'page', 'order' => 'asc');
    	echo $args;
                $echipa = new WP_Query( $args );
                $c = 0;
                if( $echipa->have_posts() ) {
                    while( $echipa->have_posts() ) {
                        $echipa->the_post();
                        $c++;
                        if( $c % 2  == 0 ) $style="echipa_color white";
                        else $style="echipa_color gray";
                        ?>
    			<div <?php post_class($style);?>>
    			<div class= "contentpart">
    				<?php the_post_thumbnail('feat'); ?>
    				<div class= contentpart-text>
                            		<h1><?php the_title() ?></h1>
                            		<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    					<?php the_content() ?>
                            		</div>
                            	</div><!-- .contentpart text -->
                            </div><!-- .contentpart -->
                            </div>
                    <?php
    }
            }
            else {
                echo 'Oh ohm no pages!';
            }
        ?>
Viewing 1 replies (of 1 total)
  • The topic ‘featured image does not show’ is closed to new replies.