[Resolvido] Custom field para trocar link do thumbnail
Bom dia.
Galera, estou com um problema que não consigo resolver...já procurei muito, e nada. E pra piorar sou meio leigo no assunto.
Mas o problema é o seguinte:
No meu tema, eu uso uma custom fild para criar um thumbnail na pagina inicial...
/applications/core/interface/imageproxy/imageproxy.php?img=http://img22.imageshack.us/img22/9241/customfield1.jpg&key=316c9292eae26fb27f1f3cf79e247d3cd23f807b5297935a02fe71bb84df54b0" alt="Imagem Postada" />
A imagem desse thumbnail, gera um link para o propio post, exemplo: http://localhost/wordpress/?p=11
Beleza. O que eu to querendo, é criar uma custom fiel, que mude esse link do post, para um outro qualquer, por exemplo:
Por padrão, seria esse link: http://localhost/wordpress/?p=11 Mas queria que aparecece esse: http://www.google.com.br (Isso é só um exemplo)
Imagino eu que a custom field deve integrar com o <?php the_permalink() ?>
Veja o codigo:
<?php get_header(); ?>
<div id="main">
<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<?php
// check for thumbnail
$thumb = get_post_meta($post->ID, 'thumbnail', $single = true);
?>
<div class="home-posts">
<div class="single-entry">
<div class="thumbnail-div">
<?php // if there's a thumbnail
if($thumb !== '') { ?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&h=125&w=306&zc=1"width="306px" height="125px" style="border: none;" alt="<?php the_title(); ?>" /></a>
<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>
</div>
<div class="single-entry-excerpt">
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title2('', '...', true, '57') ?>
</a>
<?php the_content_limit(100, ""); ?>
<div class="readmore"><a href="<?php the_permalink() ?>" rel="bookmark" style="color:#ffffff;" title="Permanent Link to <?php the_title(); ?>">Read More</a></div>
</div>
</div>
</div>
</div> <!-- end the post div-->
Bom pessoal, se puderem me ajudar, ficarei muito grato.
Abraço!
Discussão (2)
Carregando comentários...