global $post, $transfers_theme_globals; $page_title = __('Blog', 'transfers'); $transfers_blog_index_id = get_option('page_for_posts'); if ($transfers_blog_index_id > 0) { $transfers_blog_index = get_post($transfers_blog_index_id); $page_title = $transfers_blog_index->post_title; } global $transfers_theme_globals; $page_sidebar_positioning = $transfers_theme_globals->get_blog_index_sidebar_position(); $page_sidebar_positioning = empty($page_sidebar_positioning) ? '' : $page_sidebar_positioning; $section_class = ''; if ($page_sidebar_positioning == 'both') $section_class = 'one-half'; else if ($page_sidebar_positioning == 'left' || $page_sidebar_positioning == 'right') $section_class = 'three-fourth'; else $section_class = 'full-width'; $blog_index_sort_by = $transfers_theme_globals->get_blog_index_sort_by_column(); $blog_index_sort_descending = $transfers_theme_globals->blog_index_sort_descending(); $blog_index_show_grid_view = $transfers_theme_globals->blog_index_show_grid_view(); $pager_page = (get_query_var('paged')) ? get_query_var('paged') : 1; $page_id = $post->ID; if ($transfers_blog_index_id > 0) { $page_id = $transfers_blog_index_id; } $categories = wp_get_post_terms($transfers_blog_index_id, 'category', array("fields" => "ids")); $args = array( 'paged' => $pager_page, 'orderby' => $blog_index_sort_by, 'order' => ($blog_index_sort_descending ? 'ASC' : 'DESC'), 'post_type' => 'post', 'post_status' => 'publish'); if (count($categories) > 0) { $args['category__in'] = $categories; } ?>