• I have added the following html section inroder to convert it later to php ….

    <div id="section2_left">
    <h2> Students Posts </h2>
    <img src="students-in-classroom2.jpg" width="146" height="127" />
    <h3> student post title here  </h3>
       </div>

    The problem is that the image doesn’t show up when I intergrate this code in my wordpress page while it works properly on Dreamweaver CS5 and when I preview it independently !!

    do you think there could be some php function somewhere that disables images ??

    appreciate ur support !

Viewing 6 replies - 1 through 6 (of 6 total)
  • Where are you putting this code? It looks like you have a problem with the image path?

    Thread Starter Morocco English

    (@rifhawk)

    the images are in the same directory where the file is …
    I put the code after a div block of some posts

    the following code comes before the new code :

    <div class="item-content">
                            <header>
             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'noteworthy' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php if(the_title( '', '', false ) !='') the_title(); else _e( 'View Post', 'noteworthy' ); ?></a></h2>
                            </header>
           </div>
    <?php
    						if ( has_post_thumbnail()) : ?>
    
     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo the_post_thumbnail( array( 250, 250) ); ?></a>
    
    <?php else : ?>
    
                                <?php $postimgs =& get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC' ) );
    if ( !empty($postimgs) ) :
    								$firstimg = array_shift( $postimgs );
    								$my_image = wp_get_attachment_image( $firstimg->ID, array( 250, 250 ) );
    	?>
    
     <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php echo $my_image; ?></a>
     <?php endif; ?>
    
                            <?php endif; ?>
    </div>
    <?php
    
    				/* end of your output here*/
    		endwhile;
    		endif;
    		wp_reset_postdata(); ?>
    
    		 </div>
    
    		 <div class="cleaner_h10 "> </div>

    Can you post a link to your site? Why are the images in the same file and not in an uploads or media file?

    <img src="students-in-classroom2.jpg" width="146" height="127" />

    WordPress will assume that the image file is in the main directory not the themes directory. This will work if the image is in the same folder as wp-config.php

    or you can change the source path.

    Thread Starter Morocco English

    (@rifhawk)

    this sounds reasonable!
    the path will be like that :
    root/wp-content/themes/mytheme/theimage.jpg

    I will try it

    Thread Starter Morocco English

    (@rifhawk)

    It works thank you lot

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘all IMAGES are invisible except the post thumbails!’ is closed to new replies.