Sunday, 15 March 2015

How to echo a wordpress php tag -



How to echo a wordpress php tag -

this answered wanted know how can echo out php wordpress template tag when echoing html

<?php echo wp_logout_url();?> isn't working me. it's adding php code rather permalink log out.

can help?

thanks.

<?php if ( is_user_logged_in() ) { echo '<li>employee portal</li>'; echo '<li><a href="<?php echo wp_logout_url(); ?>" title="logout">logout</a></li>'; } else { echo '<li class="dropdown"><a href="/employee-portal/">employee portal</a></li>'; } ?>

of course, because in php <?php , echos. utilize instead:

echo '<li><a href="' . wp_logout_url(); .'" title="logout">logout</a></li>';

or this

<?php if (is_user_logged_in()) { ?> <!-- step out php code, here html --> <li>employee portal</li> <li><a href="<?php echo wp_logout_url(); ?>" title="logout">logout</a></li> <?php //<!-- go php } else { ?> <!-- step out php code, here html --> <li class="dropdown"><a href="/employee-portal/">employee portal</a></li> <?php //<-- go php } ?>

wordpress

No comments:

Post a Comment