Site icon Hip-Hop Website Design and Development

Adding restrictive content to a PHP Shortcode Template

Right off the bat: I’m not a coder, been doing sites for a brief time frame and this is my first post here. I never need to code, I’m certain this is an extremely rudimentary code for somebody encountered so checking whether somebody could point me in the right direction.

I have a PHP format for a shortcode from an entrance module (WP-Client) on a WordPress site that I need to add a "conditional text" to. (I previously asked them for help and they couldn’t help me).

Explanation:

When the shortcode is set on a page, it shows a message community with Inbox, Sent, Trash, and so on in English. My site is multi-lingual so I should have the option to change those names on specific pages as it were. My idea on this was to embed a code into the format that says to put "Inbox" if page ID/name is "Example 1" and put "Bandeja de entrada" if the page ID/name is "Example 2".

This is the layout I’m managing with:

 

<div class="wpc_private_messages_shortcode"> 

<div class="wpc_msg_nav_wrapper"> 

<input type="button" class="wpc_msg_new_message_button wpc_button" value="<?php _e( 'New', WPC_CLIENT_TEXT_DOMAIN ); ?>" title="<?php _e( 'New Message', WPC_CLIENT_TEXT_DOMAIN ); ?>"/> 

<div class="wpc_msg_nav_list_wrapper"> 

<div class="wpc_msg_nav_list_collapsed"></div> 

<ul class="wpc_msg_nav_list"> 

<li class="wpc_nav_button inbox" information list="inbox"><?php _e( 'Inbox', WPC_CLIENT_TEXT_DOMAIN ); ?></li> 

<li class="wpc_nav_button sent" information list="sent"><?php _e( 'Sent', WPC_CLIENT_TEXT_DOMAIN ); ?></li> 

<li class="wpc_nav_button archive" information list="archive"><?php _e( 'Chronicle', WPC_CLIENT_TEXT_DOMAIN ); ?></li> 

<li class="wpc_nav_button trash" information list="trash"><?php _e( 'Rubbish', WPC_CLIENT_TEXT_DOMAIN ); ?></li> 

</ul> 

</div> 

</div> 

As you can see, there are the 5 marks: New, Inbox, Sent, Archive, and Trash. These are the ones I should have the option to change to another dialect dependent on the page number/name.

I’ve gone through most likely 10 diverse methods of composing it yet I’m not exactly getting there.

I was thinking something as per this (however utilizing page ID/name):

<?php 

$t = date("H"); 

on the off chance that ($t < "10") { 

reverberation "Have a decent morning!"; 

} elseif ($t < "20") { 

reverberation "Have a decent day!"; 

} else { 

reverberation "Have a decent night!"; 

} 

?> 

Would like any assistance on this.

Thanks,

James