Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter white_pawn

    (@white_pawn)

    Thanks fldtrace.
    I did it the ugly way. This way at least it affects everything I ever posted. Just in case someone needs this, simply replace the_content() in your index.php with the following:

    $content = get_the_content('MORE »');
    $separator1 = "<img";
    $separator2 = "/>";
    $content = preg_split("#$separator1#",$content);
    $before = $content[0].'<a href="'.get_permalink().'"><img ';
    $after = preg_split("#$separator2#",$content[1]);
    $after = $after[0].'/></a>'.$after[1];
    $content = '<p>'.$before.$after.'</p>';
    echo $content;

    The effect can be seen here: minimalismi.com
    I’m not sure if it will affect the performance. If anyone knows of a more efficient way to do it, please let everyone know. Thanks.

    Thread Starter white_pawn

    (@white_pawn)

    Yes, I’m aware of this. However, single.php retrieves the post content via the_content(). That means I’d have to store the post content in a variable, then parse it and get rid of the link tags. I was hoping for a built-in/ready-made solution. ??

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