NEW HOTEL WORDPRESS THEME

VIEW DEMO

Event Date Language Preview

In order to change the language of the preview event of the month you have to make a change in both the main theme and the babkykids plugin “postgrid” shortocde.

bk-event-prev-data

POST GRID

For change the post grid preview you have to go in the file: ..\wp-content\plugins\nicdark-shortcodes\shortcodes\query\events_query.php and follow these steps:

  • Find these lines of code in the file:
//get date info
$eventdate = new DateTime($alldatas['metabox_event_date']);
$neweventdate = ( $alldatas['metabox_event_date'] != '' ) ? ' <a href="'.$permalink.'" class="nicdark_btn nicdark_bg_greydark white medium nicdark_radius nicdark_absolute_left">'.$eventdate->format('j').'<br><small>'.$eventdate->format('M').'</small></a> ' : '';

  • Add this line at the top of this code:
setlocale(LC_TIME, "it_IT");

Here you have to set your local time (in the example we set the Italia local time – it_IT – and you can find the full country list here).

  • Create a new variable, for example $eventdatelang and add this line of code:
    $eventdatelang = strftime("%b",strtotime($alldatas['metabox_event_date']));
  • The code will be:
//get date info
setlocale(LC_TIME, "it_IT"); 
$eventdate = new DateTime($alldatas['metabox_event_date']);
$neweventdate = ( $alldatas['metabox_event_date'] != '' ) ? ' <a href="'.$permalink.'" class="nicdark_btn nicdark_bg_greydark white medium nicdark_radius nicdark_absolute_left">'.$eventdate->format('j').'<br><small>'.$eventdate->format('M').'</small></a> ' : '';
  • Now you have to replace the new variables created in the code preview. Replace
'.$eventdate->format('M').'

with:

'.$eventdatelang.'
  • The new string will be:
$neweventdate = ( $alldatas['metabox_event_date'] != '' ) ? ' <a href="'.$permalink.'" class="nicdark_btn nicdark_bg_greydark white medium nicdark_radius nicdark_absolute_left">'.$eventdate->format('j').'<br><small>'.$eventdatelang.'</small></a> ' : '';
  • If this does not work means that the server settings override these rules and you have to ask your server provider

Copyright 2016 Clean Themes Studio - PI 04892530280