Forums

[resolved] WordPress inserting tag values in wrong area (2 posts)

  1. LazyMoon
    Member
    Posted 3 years ago #

    I'm currently working on my own WordPress template. After rewriting the header, index, etc and tested my site I recieved a couple of very wierd errors.

    Some tags would simple not produce values such as:

    echo '<title>'.bloginfo('name').'</title>';

    Would return

    <title></title>

    However, some tags would place the value, but outside of the area where the tag is placed, for example:

    echo '<div class="post-date"><span class="month">'.the_time('M').'</span><span class="day">'.the_time('j').'</span></div>';

    Would produce:

    Apr29
    <div class="post-date"><span class="month"></span><span class="day"></span></div>

    As you can see, the output of 'Apr29' should have been within the SPAN tags, but it was output elsewhere. This is happening with all of my WordPress template tags.

    Any idea why this is happening?

  2. LazyMoon
    Member
    Posted 3 years ago #

    Solved myself. If anyone else is getting this problem with the echo line, try replacing the decimals with commas:

    echo '<title>'.bloginfo('name').'</title>';
    echo '<title>',bloginfo('name'),'</title>';

    Seems to work fine with commas.

Topic Closed

This topic has been closed to new replies.

About this Topic