%PDF- %PDF-
Direktori : /proc/self/root/proc/self/root/home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/ |
Current File : //proc/self/root/proc/self/root/home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/blog.php |
<?php /** * The template to display blog archive * * @package WordPress * @subpackage ALHAMBRA * @since ALHAMBRA 1.0 */ /* Template Name: Blog archive */ /** * Make page with this template and put it into menu * to display posts as blog archive * You can setup output parameters (blog style, posts per page, parent category, etc.) * in the Theme Options section (under the page content) * You can build this page in the WPBakery Page Builder to make custom page layout: * just insert %%CONTENT%% in the desired place of content */ // Get template page's content $alhambra_content = ''; $alhambra_blog_archive_mask = '%%CONTENT%%'; $alhambra_blog_archive_subst = sprintf('<div class="blog_archive">%s</div>', $alhambra_blog_archive_mask); if ( have_posts() ) { the_post(); if (($alhambra_content = apply_filters('the_content', get_the_content())) != '') { if (($alhambra_pos = strpos($alhambra_content, $alhambra_blog_archive_mask)) !== false) { $alhambra_content = preg_replace('/(\<p\>\s*)?'.$alhambra_blog_archive_mask.'(\s*\<\/p\>)/i', $alhambra_blog_archive_subst, $alhambra_content); } else $alhambra_content .= $alhambra_blog_archive_subst; $alhambra_content = explode($alhambra_blog_archive_mask, $alhambra_content); // Add VC custom styles to the inline CSS $vc_custom_css = get_post_meta( get_the_ID(), '_wpb_shortcodes_custom_css', true ); if ( !empty( $vc_custom_css ) ) alhambra_add_inline_css(strip_tags($vc_custom_css)); } } // Prepare args for a new query $alhambra_args = array( 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish' ); $alhambra_args = alhambra_query_add_posts_and_cats($alhambra_args, '', alhambra_get_theme_option('post_type'), alhambra_get_theme_option('parent_cat')); $alhambra_page_number = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1); if ($alhambra_page_number > 1) { $alhambra_args['paged'] = $alhambra_page_number; $alhambra_args['ignore_sticky_posts'] = true; } $alhambra_ppp = alhambra_get_theme_option('posts_per_page'); if ((int) $alhambra_ppp != 0) $alhambra_args['posts_per_page'] = (int) $alhambra_ppp; // Make a new query query_posts( $alhambra_args ); // Set a new query as main WP Query $GLOBALS['wp_the_query'] = $GLOBALS['wp_query']; // Set query vars in the new query! if (is_array($alhambra_content) && count($alhambra_content) == 2) { set_query_var('blog_archive_start', $alhambra_content[0]); set_query_var('blog_archive_end', $alhambra_content[1]); } get_template_part('index'); ?>