Робочий візит до Харкова Міністра аграрної політики та продовольства України Ігоря Швайки
global $wpdb,$sitepress;
$locale = $sitepress->get_current_language();
$page = get_option('gallery_page_'.$locale,true);
$current_page = get_the_ID();
if($current_page == $page) {
$myrows = $wpdb->get_results( "
SELECT `post_id` FROM `wp_postmeta`,`wp_icl_translations`
WHERE `meta_key` = 'bind_gallery_id'
AND `meta_value` = '".$gallery->ID."'
AND (
`element_id` = `post_id`
AND language_code = '".$locale."'
)
");
if($myrows) {
echo __("Follow posts have that gallery:","darhoda").'
'.'
'; echo '
'.'
'; echo '
- ';
foreach($myrows as $link){
echo '
- '.get_the_title($link->post_id).' '; } echo '