HTML inside PHP
-
I have the following line of code in a page template and I want to make it conditional on the post category. The problem I’m facing is nested PHP.
<p><?php the_time(__("F j, Y", 'organicthemes')); ?> · <a href="<?php the_permalink(); ?>#respond"><?php comments_number(__("Leave a Comment", 'organicthemes'), __("1 Comment", 'organicthemes'), __("% Comments", 'organicthemes')); ?></a>?<?php edit_post_link(__("(Edit)", 'organicthemes'), '', ''); ?></p>
I do something like this, and it doesn’t work…for obvious reasons.
<?php if (!in_category(array('bishop-column','bishops-blog'))) <p><?php the_time(__("F j, Y", 'organicthemes')); ?> · <a href="the_permalink(); #respond> comments_number(__("Leave a Comment", 'organicthemes'), __("1 Comment", 'organicthemes'), __("% Comments", 'organicthemes')); ?></p>
My problem is I don’t know how to approach it.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘HTML inside PHP’ is closed to new replies.