i want to get the wordpress title post to a span tag.
i use the code below with the_title() in span tags:
<?php echo '<div>
<img src="image.jpg"/>
<h2><span>'.the_title().'</span>
</h2></div>'; ?>
but the title is show in a tag P, the result is:
<p>TITLE_OF_THE_POST_IS_SHOW_HERE
<div>
<img src="image.jpg"/>
<h2><span></span>
</h2></div>
in result, the span tags is empty, how do insert the title in the span tag?
get_the_title()
, probably, as per usual with wordpress.the_foo()
outputs data,get_the_foo()
returns the data – Marc B