Avoiding nested php code
-
I am using the Customizable Post Listings plugin by Scott Reilly and running WordPress 1.5.2. The plugin works fine, but I am trying to write a tiny bit of code so that it will show up in my sidebar except on the main page. At the moment, my code looks like this:
<?php if (!is_home()) { ?>
<h2>Recent Posts</h2>
<ul>
<?php c2c_get_recent_posts(5, "<li>%post_URL%<br />%post_excerpt_short%</li>"); ?>
</ul>
<?php } ?>After it didn’t work, I realized it was because I had php code nested inside other php code. The only reason this occurred to me is because someone on this forum corrected the same type of error for me on another occasion.
If someone proficient in php and WordPress could suggest a way around this problem I’d be most grateful.
- The topic ‘Avoiding nested php code’ is closed to new replies.