• I use this fonction:

    `<?php function k99_attachment_image_link_void( $content ) {
    $content =
    preg_replace(array(‘{<a[^>]*><img}’,'{ />}’), array(‘<img’,’/>’), $content);

    return $content;
    }

    add_filter( ‘the_content’, ‘k99_attachment_image_link_void’ );

    ?>’

    This function remove the link of my images.

    My images are called like this:

    imagesname_188x145.jpg

    How to change the width and the height (actyaly 188×145) of the image in this function (the width and the height that I want is 300×231).

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Could you be more clear about what you are trying to achieve with this function? I don’t follow your setup and what you want to do.

    Thread Starter eiffel74

    (@eiffel74)

    The function remove the link of the image, what I want is to change the file name.

    The original file name have the size of the picture (18& by 145 and is call by -188×145) and I want to change this by 300×231.

    Thanks

    How about using a simple string replace

    $content = str_replace("188x145", "300x231", $content);

    Thread Starter eiffel74

    (@eiffel74)

    Why I did’nt thik about this.

    It is working

    Thanks

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

The topic ‘Preg-replace file name’ is closed to new replies.