Forum Moderators: coopster
I have this line of code:
<a href="http://mysite.com/wordpress/?author=<?php echo wp_get_current_user()->ID; ?>">Category</a>
This does what I want it to do. However I would like to insert this inside another piece of PHP. Like this:
<?php if (is_user_logged_in() ) {
echo '
<div class="dbx-box">
<h3 class="dbx-handle">Categories</h3>
<div class="dbx-content">
<ul>
<a href="http://mysite.com/wordpress/?author=<?php echo wp_get_current_user()->ID; ?>">Category</a>
</ul>
</div>
</div>';}
?>
This doesn't work. I'm assuming it's because I have php tags nested within php tags.
Does anyone know how I would fix this?
Thanks!
Should work.. You can take out the PHP tags because they're already open.