Look at this PHP file:
https://github.com/restrictcontentpro/restrict-content-pro/blob/master/templates/register-total-details.php
It includes the following:
<tr class="rcp-total">
<th><?php _e( 'Total Today', 'rcp' ); ?></th>
<th><?php rcp_registration_total(); ?></th>
</tr>
I want that part to show only if the user is logged in.
So I need to do a check for
if ( is_user_logged_in() )
then show that code.
If user is not logged in, skip that part of the code.
What do I change?
Thanks.
Arnav Joy answers:
here it is
<?php if ( is_user_logged_in() ) { ?>
<tr class="rcp-total">
<th><?php _e( 'Total Today', 'rcp' ); ?></th>
<th><?php rcp_registration_total(); ?></th>
</tr>
<?php } ?>
Sébastien | French WordpressDesigner answers:
if ( is_user_logged_in() ) { ?>
<tr class="rcp-total">
<th><?php _e( 'Total Today', 'rcp' ); ?></th>
<th><?php rcp_registration_total(); ?></th>
</tr>
<?php }
Sébastien | French WordpressDesigner comments:
arnav code is better
Rempty answers:
<tr class="rcp-total">
<th><?php _e( 'Total Today', 'rcp' ); ?></th>
<th><?php rcp_registration_total(); ?></th>
</tr>
Replace with
<?php
if ( is_user_logged_in() ){
?>
<tr class="rcp-total">
<th><?php _e( 'Total Today', 'rcp' ); ?></th>
<th><?php rcp_registration_total(); ?></th>
</tr>
<?php
}
?>