WordPress.org

Ready to get started?Download WordPress

Forums

Aggregate posts with SWT - thumbnail issue (1 post)

  1. Jacob311
    Member
    Posted 1 year ago #

    I am able to aggregate content from child sites including the post title and content of the articles, but the thumbnails do not show. My testing area is dsnamerica.com/test

    You'll notice the different sections on the index page that have different sized images for the thumbnails. This is set up like this in the functions file:

    if( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );	 add_theme_support( 'homepostthumbnails' );
    	set_post_thumbnail_size( 'secslider', 302, 238, true );
    	add_image_size( 'colorcontentblock4', 205, 120, true );
        add_image_size( 'featbigimg', 418, 215, true );
         add_image_size( 'secslider', 302, 238, true );
           add_image_size( 'content2', 150, 75, true );
                   add_image_size( 'smblock1_block_l', 200, 150, true );
         add_image_size( 'smblock1_wrap_r1', 81, 61, true );
         add_image_size( 'smblock2_block_l', 328, 181, true );
                  add_image_size( 'smblock3_block_l', 284, 190, true );
                           add_image_size( 'smblock4_block_l', 99, 66, true );
                     add_image_size( 'smblock5_block_l', 129, 67, true );
                   add_image_size( 'smblock6_block_l', 138, 104, true );
    			add_image_size( 'sidebar-thumb', 50, 50, true );
       add_image_size( 'relatedimg', 55, 55, true );    }

    A section (we'll use the slider at the top for this example) of the index.php file that should display the thumbnails:

    <div class="slides_container">
    		   <?php query_posts('showposts=5&cat='.of_get_option('example_select_categories').'&offset=0'); if (have_posts()) : ?>
     	<?php while (have_posts()) : the_post(); ?>
               	<div class="slide slides_threewrap">
                 <?php if(get_option('thumbok')!="no"):?>  <?php if( has_post_thumbnail() ) { ?>
                <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('secslider'); ?></a>
                 <?php } else { ?>
               <a href="<?php the_permalink(); ?>">  <img src="<?php bloginfo('template_directory'); ?>/img/noimg.png" alt=" " style="width:302px; height:238px;" /> </a><?php } ?>
               <?php endif?>
               <?php if(get_option('thumbok')!="yes"):?>
    <?php 	$m_scrp = get_template_directory_uri() . '/includes/timthumb.php?';
                        	$m_image = ''; $m_image_def = get_template_directory_uri() . '/img/noimg.png';
                        	$customfields = get_post_custom();  if (empty($customfields['image'][0])) {
    $m_image = m_theme_capture_first_image(); } else { $m_image = $customfields['image'][0]; } if (empty($m_image)) { $imgpath = $m_image_def;  	} else {
    $imgpath = $m_scrp . 'src=' . $m_image . '&w=' . 302 . '&h=' . 238 . '&zc=1'; } ?>
      <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
      <img src="<?php echo $imgpath; ?>" alt="" /> </a>
     <?php endif?>
              <h2> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
          <?php the_content_limit('300'); ?>
          <div class="smallgal_meta">On <?php the_time('M j, Y') ?> <b>//</b> in <?php the_category(', ') ?> <b>//</b> <?php comments_popup_link(__('# 0'), __('# 1'), __('# %')); ?></div>
    		 <div class="cb"></div>
    		</div> <?php endwhile; ?>	<?php else : ?> 	<?php endif; ?>
    		</div>

    I have tried other plugins but they just won't do what SWT does and many people seem to be having great success with it. What do you see in my index or function file that might be messing with it?

    I know from the Codex that they shouldn't be using showposts anymore, but... that's what it is. If I need to change that, please walk me through it. "Wits end" is appropriate here.

    Thanks all

Topic Closed

This topic has been closed to new replies.

About this Topic