• Resolved Amit Biswas

    (@amitbiswas06)


    Dear friends,

    I am new WP user and please forgive me for any mistakes when explaining my issue.

    I am having an issue with “echo”. Here is the situation –

    <?php echo '<p><img src="' . bloginfo('stylesheet_directory') . '/images/img-1.jpg" /></p>' ?>

    When I am trying this, the output is totally different. The url is displaying outside the <p> tag.

    Like this –

    http://127.0.0.1/wp/wp-content/themes/ThemeName<p><img src="/images/img-1.jpg" /></p>

    But simple use like this – is working great. Why the above is not working? –

    <figure><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img-1.jpg" /></figure>

    I really don’t know how to fix it. Please help me anyone.

    Thanks!
    -Amit

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘echo issue with WP function [Help]’ is closed to new replies.