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

    (@polymathnyc)

    Hi Nakul,

    A better way to reference your images is to place them in your theme and reference like this:

    <img src="<?php echo bloginfo('template_directory'); ?>/images/img1.png" alt="">

    The PHP chunk in the src will print out your active theme directory relative to the WordPress URL. This way your image links won’t be broken when you publish to a different environment.

    Hi Nakul,
    Sorry for late response. I also had similar problem but when I moved my image to “image” folder located inside the “wp-includes” folder, the link worked perfectly.
    https://localhost/wordpress/wp-includes/images/yourimage.jpg&#8221;

    Have a wonderful day

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Relative Path of image is not working in local server.’ is closed to new replies.