PHP Code Not Working
-
First off, thanks for all your hard work on this plugin! I’ve got it working great with some random image Javascript goodness. But I’m having trouble getting the following PHP code to render…
<?php if (is_user_logged_in()): ?> <?php require('/home/userx/public_html/chatroom/chat.php'); ?> <?php else: ?> <p>You must be logged in to join the chat.</p> <?php endif; ?>
I have tried removing all the opening <?php and closing ?> tags as directed. I have also tried including the entire code, wrapping it in close/open tags as suggested here.
I hard-coded this into a page template and confirmed that the chat room renders and functions, but I’d much rather use a shortcode to insert it in a page. What might I be doing wrong?
Does each function need to be in a separate Content Block? And if so, how do I handle the if/else statement and content?
Thanks again for any direction anyone can provide!
- The topic ‘PHP Code Not Working’ is closed to new replies.