This is my code inside my custome function
<?php
function ArabicDate( $time = false ) {
if ( $time === false ) {
$time = current_time( ‘timestamp’ );
}
$months = array(“Jan” => “?????”, “Feb” => “??????”, “Mar” => “????”, “Apr” => “?????”, “May” => “????”, “Jun” => “?????”, “Jul” => “?????”, “Aug” => “?????”, “Sep” => “??????”, “Oct” => “??????”, “Nov” => “??????”, “Dec” => “??????”);
$your_date = date( ‘y-m-d’, $time ); // The Date calculated from the $time variable
$en_month = date(“M”, $time );
foreach ($months as $en => $ar) {
if ($en == $en_month) { $ar_month = $ar; }
}
$find = array (“Sat”, “Sun”, “Mon”, “Tue”, “Wed” , “Thu”, “Fri”);
$replace = array (“?????”, “?????”, “???????”, “????????”, “????????”, “??????”, “??????”);
$ar_day_format = date(‘D’, $time); // The Current Day
$ar_day = str_replace($find, $replace, $ar_day_format);
$standard = array(“0″,”1″,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”9”);
$eastern_arabic_symbols = array(“?”,”?”,”?”,”?”,”?”,”?”,”?”,”?”,”?”,”?”);
// use this line to format your arabic date
$current_date = $ar_day.’ ‘.date( ‘d’, $time ).’ / ‘.$ar_month.’ / ‘.date( ‘Y’, $time );
$arabic_date = str_replace($standard , $eastern_arabic_symbols , $current_date);
return $arabic_date;
}
?>
<?php
function convert_numbers_to_arabic($n) {
$arabic_numbers = array(‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘?’, ‘.’);
$english_numbers = array(‘0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’, ‘.’);
return str_replace($english_numbers, $arabic_numbers, $n);
}
function arabic_date_i18n( $j ) {
if ( get_bloginfo( ‘language’ ) == ‘ar’ ) {
$j = convert_numbers_to_arabic( $j );
}
return $j;
}
add_filter(‘date_i18n’, ‘arabic_date_i18n’);
?>
<?php
function new_excerpt_more($more) {
global $post;
remove_filter(‘excerpt_more’, ‘new_excerpt_more’);
return ‘…’;
}
add_filter(‘excerpt_more’,’new_excerpt_more’);
?>
<?php
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes’ );
function my_module_add_grid_shortcodes( $shortcodes ) {
$shortcodes[‘vc_post_id’] = array(
‘name’ => __( ‘Upcoming Tenders’, ‘my-text-domain’ ),
‘base’ => ‘vc_post_id’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘description’ => __( ‘Show Upcoming Tenders’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
// output function
add_shortcode( ‘vc_post_id’, ‘vc_post_id_render’ );
function vc_post_id_render() {
return
‘<p style=”color: #a29061 !important;font-size: 20px;line-height:1;padding-top: 5px;”>{{ post_data:post_title }}</p>’.
‘<span class=”FixMe”>Tender No:<span class=”PostBOX”>{{ post_data:tender_no}}</span></span><span class=”FixMe2″>Published Date:<span class=”PostBOX”>{{post_data:published_date }}</span></span><span class=”FixMe”>Closing Date:<span class=”PostBOX”>{{ post_data:closing_date }}</span></span>’.
‘
<span style=”font-size: 15px;”>{{ post_data:post_excerpt }}</span>’.
‘<p style=”color: #00798c;font-size: 13px;background-image: url(https://www.duqmterminal.com/wp-content/uploads/2016/07/pdf.svg);background-repeat: no-repeat;background-position:right;padding-right: 25px;display: inline-block;padding-bottom:5px;text-decoration: none;”>
<span class=”OnlyEng”>More</span><span class=”OnlyArb”>??????</span>
</p>’;
}
?>
<?php
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes_V2’ );
function my_module_add_grid_shortcodes_V2( $shortcodes ) {
$shortcodes[‘vc_say_hello’] = array(
‘name’ => __( ‘CAREER OPPORTUNITIES’, ‘my-text-domain’ ),
‘base’ => ‘vc_say_hello’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘type’ => ‘textfield’,
‘description’ => __( ‘Just outputs CAREER OPPORTUNITIES’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( ‘vc_say_hello’, ‘vc_say_hello_render’ );
function vc_say_hello_render() {
return
‘<p style=”color: #a29061 !important;font-size: 20px;line-height:1;padding-top: 5px;”>{{ post_data:post_title }}</p>’.
‘<span class=”PostBOX” style=”margin-left: 0px;”>[acf field=date]</span>’.
‘<span style=”color: #344553 !important;line-height:1;padding-top: 5px;font-size:15px;”>[acf field=job_description]</span>’.
‘<p style=”color: #a29061 !important;line-height:1;padding-top: 5px;text-align:right;”>
<span class=”OnlyEng”>Apply</span><span class=”OnlyArb”>?????</span>
</p>’;
}
?>
<?php
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes_V3’ );
function my_module_add_grid_shortcodes_V3( $shortcodes ) {
$shortcodes[‘vc_say_hello_V3’] = array(
‘name’ => __( ‘Downloads Date’, ‘my-text-domain’ ),
‘base’ => ‘vc_say_hello_V3’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘type’ => ‘textfield’,
‘description’ => __( ‘Just outputs Downloads’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( ‘vc_say_hello_V3’, ‘vc_say_hello_V3_render’ );
function vc_say_hello_V3_render() {
return
‘<span class=”PostBOX” style=”margin-left: 0px;”>[acf field=”date”]</span>’;
}
?>
<?php
add_filter(‘gettext’, ‘qtranxf_gettext’,0);
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes_V4’ );
function my_module_add_grid_shortcodes_V4( $shortcodes ) {
$shortcodes[‘vc_say_hello_V4’] = array(
‘name’ => __( ‘Downloads Link’, ‘my-text-domain’ ),
‘base’ => ‘vc_say_hello_V4’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘type’ => ‘textfield’,
‘description’ => __( ‘Just outputs Downloads Link’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( ‘vc_say_hello_V4’, ‘vc_say_hello_V4_render’ );
function vc_say_hello_V4_render() {
return
‘<p style=”color: #00798c;font-size: 13px;display: inline-block;padding-bottom:5px;text-decoration: none;”>
<span class=”OnlyEng”>Download</span><span class=”OnlyArb”>?????</span>
</p>’;
}
?>
<?php
apply_filters(‘qtranslate_text’, $str);
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes_V5’ );
function my_module_add_grid_shortcodes_V5( $shortcodes ) {
$shortcodes[‘vc_say_hello_V5’] = array(
‘name’ => __( ‘Content for NEWS’, ‘my-text-domain’ ),
‘base’ => ‘vc_say_hello_V5’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘type’ => ‘textfield’,
‘description’ => __( ‘Just outputs NEWS Content’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( ‘vc_say_hello_V5’, ‘vc_say_hello_V5_render’ );
function vc_say_hello_V5_render() {
return
‘
<span class=”POST_TEXT_50Perc”>[acf field=home_content]</span>
<p>
<span style=”font-size:13px;” class=”OnlyArb”>
????
</span>
<span style=”font-size:13px;” class=”OnlyEng”>
more
</span>
<span style=”position: absolute;
margin-left: 0px;
margin-top: -10px;”>
<svg version=”1.1″ id=”Layer_1″ xmlns=”https://www.w3.org/2000/svg” xmlns:xlink=”https://www.w3.org/1999/xlink” x=”0px” y=”0px”
width=”15px” height=”9.333px” viewBox=”0 0 15 9.333″ enable-background=”new 0 0 15 9.333″ xml:space=”preserve”>
<polygon fill=”#00798C” points=”0.121,0 7.5,7.355 14.879,0 “/>
</svg>
</span>
</p>
‘
;
}
?>
<?php
add_filter( ‘vc_grid_item_shortcodes’, ‘my_module_add_grid_shortcodes_V6’ );
function my_module_add_grid_shortcodes_V6( $shortcodes ) {
$shortcodes[‘vc_say_hello_V6’] = array(
‘name’ => __( ‘Content for NEWS Home Feed’, ‘my-text-domain’ ),
‘base’ => ‘vc_say_hello_V6’,
‘category’ => __( ‘Content’, ‘my-text-domain’ ),
‘type’ => ‘textfield’,
‘description’ => __( ‘Just outputs NEWS Content Home Feed’, ‘my-text-domain’ ),
‘post_type’ => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( ‘vc_say_hello_V6’, ‘vc_say_hello_V6_render’ );
function vc_say_hello_V6_render() {
return
‘<span class=”POST_TEXT_50Perc” style=”color: white;padding-top: 10px;”>[acf field=home_content]</span>’
;
}
?>