I have a loop, and need to pass one more argument through it. I need to get the current page's single post title, and then use that as the value.
I tried going about it like this:
$tagz = the_title();
$args = array(
'post_type' => 'product',
'posts_per_page' => 5,
'product_tag' => "{$tagz}" );
and the $tagz
variable just automatically echo's the current post title. I found out through this resource this resource that the_title()
merely echos the title and never returns it, making the $tagz
variable null.
How can I use the current posts title as an argument? I am really stumped!!
$tagz = the_title( ''. '', 0 );
?$tagz = the_title( ''. '', false );
but it's the same thing, and it worked!!!!!!! I reread the resource I linked, and now I understand it better because of you. I just started learning php last month, thank you so much :D you've made an impact on my life, stranger!