![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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]&h=<?php echo get_theme_mod($position.'_thumb_height'); ?>&w=<?php echo get_theme_mod($position.'_thumb_width'); ?>&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 | |
|
|
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 |
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us