WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Why No Images In Blog? (7 posts)

  1. johnywhy
    Member
    Posted 4 years ago #

    why isn't my theme showing images in the blog?

    here's the whole theme's index.php:

    <?php get_header(); ?>
    
    	<div id="page">
    
    		<div id="contentleft">
    
    <?php if ( $paged < 2 ) { // Do stuff specific to first page?>
    
    <?php $my_query = new WP_Query('category_name=featured&showposts=1');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID; ?>
    
    				<div class="featurepost" id="post-<?php the_ID(); ?>">
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    					<p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> in <?php the_category(', ') ?> | <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?></p>
    
    					<div class="entry">
    						<?php the_content('Read the rest'); ?>
    					</div>
    
    				</div>
    
    <?php endwhile; ?>
    
    <?php query_posts(array('post__in'=>get_option('sticky_posts'))); ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post();
    
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
    				<div class="post" id="post-<?php the_ID(); ?>">
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    					<p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> in <?php the_category(', ') ?> | <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?></p>
    
    					<div class="entry">
    						<?php the_content('Read the rest'); ?>
    					</div>
    
    				</div>
    
    <?php endwhile; endif; ?>
    
    <?php } else { // Do stuff specific to non-first page ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
    
    				<div class="post" id="post-<?php the_ID(); ?>">
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    					<p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> | In <?php the_category(', ') ?> | <?php comments_popup_link('No Comments &raquo;', '1 Comment &raquo;', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?></p>
    
    					<div class="entry">
    						<?php the_content('<strong>Read the rest &raquo;</strong>'); ?>
    					</div>
    
    				</div>
    
    <?php endwhile; endif; ?>
    
    <?php } ?>
    
    				<div class="navigation">
    					<div class="alignleft">
    						<?php posts_nav_link('','','&laquo; Previous Entries') ?>
    					</div>
    					<div class="alignright">
    						<?php posts_nav_link('','Next Entries &raquo;','') ?>
    					</div>
    					<div style="clear:both;"></div>
    				</div>
    
    		</div>
    
    <?php get_sidebar(); ?>
    
    	</div>
    
    <?php get_footer(); ?>
  2. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    link to site helps

  3. johnywhy
    Member
    Posted 4 years ago #

  4. johnywhy
    Member
    Posted 4 years ago #

    see solution below

  5. wordprest
    Member
    Posted 4 years ago #

    from my end I don't see posts at all.

  6. johnywhy
    Member
    Posted 4 years ago #

    my bad. i figured out the problem. my images are links in custom fields, displayed by custom code in single.php. i needed to copy that custom code into index.php to get the images on the blog frontpage!

    wordpest, this link should work (but not for long, i'm changing my frontpage from static to recent posts in a minute)

  7. wordprest
    Member
    Posted 4 years ago #

    yeah, it runs fine! ;-)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags