StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-02-2009, 09:07 PM
rattankeeper rattankeeper is offline
Registered User
Pro Plus Member
 
Join Date: May 2009
Posts: 15
Default Problems bringing thumbs into blog and categories

Hi,

I've been trying to follow the instructions on the earlier forum post about bringing thumbnail images from the front page into my blog and category pages.

I've hit a snag.

When I cut the new code from the earlier post and paste it into archive.php, and then open a category page, here's the message I get:

Parse error: syntax error, unexpected '[' in ... archive.php on line 6

Any idea what that's all about?

Here's what the code looks like in my archive.php, with the new code in bold:


Code:
<?php get_header(); 
function sp_post_thumb($post, $position) {
if( get_post_meta($post->ID, "thumb", true) ):
?>
<a href="<?php the_permalink() ?>" rel="bookmark">
[img]<?php bloginfo('template_directory'); ?>/tools/timthumb.php?src=<?php echo get_post_meta($post->ID, [/img]&amp;h=<?php echo get_theme_mod($position.'_thumb_height'); ?>&amp;w=<?php echo get_theme_mod($position.'_thumb_width'); ?>&amp;zc=1" alt="<?php the_title(); ?>" />
</a>
<?php
else:
// You might want to show a default image?
endif;
}
?>
<div id="content">
<div id="contentleft">
 
<div class="postarea">
 
<?php include(TEMPLATEPATH . '/includes/breadcrumb.php');?>
 
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 
<div <?php post_class(); ?>>
 
<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
 
<?php require(TEMPLATEPATH . '/includes/post-author-block.php'); ?>
<?php the_excerpt(__('[Read more]', 'studiopress'));?>
 
<div class="clear"></div>
 
<?php require(TEMPLATEPATH . '/includes/post-meta-block.php'); ?>
 
</div>
 
<?php endwhile; else: ?>
 
<?php require(TEMPLATEPATH . '/includes/post-nav-block.php'); ?>
<?php endif; ?>
 
<?php require(TEMPLATEPATH . '/includes/post-nav-block.php'); ?>
 
</div>
 
</div>
 
<?php include(TEMPLATEPATH."/sidebar.php");?>
</div>
<?php get_footer(); ?> 

Last edited by SoZo; 12-02-2009 at 09:52 PM. Reason: Wrapped code in code brackets
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thumbs in the list view of Categories? lindebjerg General Discussion 5 03-05-2012 03:32 PM
How to bring thumbs into each post in categories? speedmouse General Discussion 25 04-26-2010 04:14 PM
Display Thumbs in Categories pluz General Discussion 4 08-04-2009 04:05 PM
Problems with thumbs itsfashionbaby General Discussion 42 07-28-2009 08:52 AM


All times are GMT -5. The time now is 08:02 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.