KarlBee
01-10-2010, 09:11 AM
Hi all,
I'm having a little problem getting an 'echo' to work. The code below works but it shows as domain.com/<?php the_permalink() ?> instead of rendering the URL. I think I have may be missing a single or double quote but not sure.
Here is my code:
<ul>
<?php $my_query = new WP_Query('showposts=3&offset=1&cat=1'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php // Generates alternate tile for boxes
$title = get_post_meta($post->ID, "custom-title-value", true);
if ($title != "") {
echo '<li><a href="<?php the_permalink() ?>">'.$title.'</a></li>';
} else { ?>
<li><a href="<?php the_permalink(); ?>"><?php $title = get_the_title(); echo shrink_text($title,27) ?></a></li>
<?php } ?>
<?php endwhile; ?>
</ul>
Any suggestions greatly appreciated.
Thanks,
Karl
I'm having a little problem getting an 'echo' to work. The code below works but it shows as domain.com/<?php the_permalink() ?> instead of rendering the URL. I think I have may be missing a single or double quote but not sure.
Here is my code:
<ul>
<?php $my_query = new WP_Query('showposts=3&offset=1&cat=1'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php // Generates alternate tile for boxes
$title = get_post_meta($post->ID, "custom-title-value", true);
if ($title != "") {
echo '<li><a href="<?php the_permalink() ?>">'.$title.'</a></li>';
} else { ?>
<li><a href="<?php the_permalink(); ?>"><?php $title = get_the_title(); echo shrink_text($title,27) ?></a></li>
<?php } ?>
<?php endwhile; ?>
</ul>
Any suggestions greatly appreciated.
Thanks,
Karl