• Hello,
    I was on the irc and I am having a similar problem as was someone else. Here is what i’m trying to do:

    <?php
    
    $cat_image = get_post_meta($post->ID, "catimage", true);
    $cat_url = the_permalink();
    $out = '<span><a href="' . $cat_url . '"><img src="' . $cat_image . '" border="0"></a></span>';
    echo (!empty($cat_image) && strpos($cat_image, 'thumbnail')) ?  $out  : '';
    ?>

    The problem is that the_permalink() does an echo and not a return. So I am can capture the string because its echoed out.

    If you’re wondering why i am checking strpos is because I have a category which has 12 posts. Only a few of them have a custom field for catimage (category image). If they have that field, grab the value – the image path.

    What i’ve noticed is that the posts that do not have the custom field, it still spits out the site (www.site.com/category/month/day/year/) which it shouldn’t but thats for another day. Today i need your help in getting the_permalink.

    thanks. Please post anycode it would be great.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘the_permalink issue’ is closed to new replies.