Can anyone explain why this code fails?
-
Trying to apply wordpress function results to my php variables for display.
I get the results from the functions the_date(), the_title(), etc. but the text does not display correctly in the DIVs. What is going on here? Why does this NOT work?
$home_content .= "<div style=''>"; $posts = get_posts('numberposts=10&order=ASC&orderby=post_title'); foreach ($posts as $post) : setup_postdata($post); $home_content .= "<div style='color:red;font-size:12px;'>".the_date()."</div>"; $home_content .= the_title(); $home_content .= the_excerpt(); endforeach; $home_content .= "</div>";
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Can anyone explain why this code fails?’ is closed to new replies.