• Resolved fotokristian

    (@fotokristian)


    I use this code inside the loop:

    <?php $customField = get_post_custom_values("norwegian");
    if (isset($customField[0])) {
        echo "<a class='cssthingie' href=\"<?php the_permalink() ?>\">text in norwegian</a>";
    
    } else {
    	echo "<a class='cssthingie' href=\"<?php the_permalink() ?>\">text in english</a>";
    }
    
    ?>

    Now, the problem is the <?php the_permalink() ?> inside the echo. Is there away to solve this?. The link generated is website.com/<?php the_permalink() ?>.

    -Kristian

Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘PHP problem with custom fields inside loop’ is closed to new replies.