public static function is_blog() { global $is_blog; if ($is_blog == true) { return true; } $blog_page_id = theme_get_option('blog', 'blog_page'); if (empty($blog_page_id)) { return false; } if (wpml_get_object_id($blog_page_id, 'page') == get_queried_object_id()) { $is_blog = true; return true; } return false; }
<?php get_header(); $page = theme_get_option('homepage', 'home_page'); if ($page) { $page_date = get_page(wpml_get_object_id($page, 'page')); $content = $page_date->post_content; } else { $content = theme_get_option('homepage', 'content'); } $layout = theme_get_option('homepage', 'layout'); theme_generator('SlideShow'); ?> <div id="page" class="home"> <div class="inner <?php if ($layout == 'right') { ?> right_sidebar<?php } if ($layout == 'left') { ?> left_sidebar<?php } ?> "> <div id="main"> <div class="content"> <?php echo apply_filters('the_content', stripslashes($content)); ?> <div class="clearboth"></div>
function is_blog() { global $post; global $is_blog; if ($is_blog == true) { return true; } $blog_page_id = theme_get_option('blog', 'blog_page'); if (isset($post->ID)) { if (wpml_get_object_id($blog_page_id, 'page') == $post->ID) { $is_blog = true; return true; } } return false; }
function suffusion_get_wpml_lang_object_ids($ids_array, $type) { if (function_exists('icl_object_id')) { $res = array(); foreach ($ids_array as $id) { $trans = wpml_get_object_id($id, $type, false); if (!is_null($trans) && !in_array($trans, $res)) { $res[] = $trans; } } return $res; } return $ids_array; }