SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    818
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Posts and thumbnails do not display

    Trying to get my posts to display at the bottom of the page in four separate slots.

    i have enabled the thumbnails function in functions.php
    Code:
    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 50, 50, true );
    and started adding this code to the index.php page.

    Code:
    <div id="row02" class="row-fluid">
    <div class="thumbnails">
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<div class="span3">
    
    			<?php the_post_thumbnail(); ?>
    			<h4><?php the_title(); ?></h4>
    			<?php include (TEMPLATEPATH . '/inc/meta.php' ); ? >
    
    			<?php the_excerpt(); ?>
    			<a href="<?php the_permalink(); ?>" class="btn btn-mini">read more</a>
    			</div>	
    
    			<?php endwhile; endif; ?>
    
    			</div>	
    
    			<div class="span3">
    			span3
    			</div>
    			<div class="span3">
    			span3
    			</div>	
    
    			<div class="span3">
    			span3
    			</div>
    </div> <!-- end thumbnails -->
    </div> <!-- end row -->
    better yet I would like a post from specific categories show up in each slot. so far it isn't quite working. so slot 1 is engineering, slot two grabs the post from IT. And so on
    When I put it in the page.php it was simply grabbing the text from the page it was on.
    in index.php it is grabbing something...
    and the thumbnails are not showing up.
    Also right now something shows up in chrome but not firefox.
    and the practice site is at www.thebigmeow.us

    Thank you
    D

  2. #2
    SitePoint Zealot Siick26's Avatar
    Join Date
    May 2013
    Location
    England
    Posts
    113
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thumbnails seem to be a big problem with Wordpress, i once had a WP site and whenever i shared a page on Facebook it never showed the thumbnail, i know that's a different problem to yours but you're not alone in the thumbnail problem.

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    818
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Got a tip to use WP_Query() instead of query_posts()
    But what I meant was having the thumbnails show up on the wp site itself.

    have a great day
    D

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    818
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    solved, and in case it helps anyone else.

    This is what I have in the function php

    Code:
    add_theme_support( 'post-thumbnails' );
    //set_post_thumbnail_size( 50, 50, true );
    (keeping the tnail at a larger size)

    This is the code I placed on the home page.

    Code:
    			<?php query_posts("post_per_page=2"); the_post(); ?>
    			<?php the_date(); ?>
    			<?php the_post_thumbnail(); ?>
    			<h4><?php the_title(); ?></h4>
    			<?php the_excerpt(); ?>
    			<a href="<?php the_permalink(); ?>" class="btn btn-mini">read more</a>
    			<?php wp_reset_query(); ?>
    works :-)
    you can see it (until I scrap it or break it)at the bottom of the home page of the bigmeow.us

    Would love to know exactly what <?php wp_reset_query(); ?> is or does or why it is needed here.

    And anyone knows how to display this posts next to each other? let's say I want to display the four more recent posts by their category? Advice? is that a parameter I can pass?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •