Пример #1
0
function query_loop($arg = array(), $loop_template, $cache = true, $group = 'looping')
{
    $data = false;
    if (empty($loop_template) || !is_string($loop_template)) {
        return new WP_Error('Missing arguments', __("query_loop missing template", TRANSLATE_DOMAIN));
    }
    if (!isset($arg['posts_per_page'])) {
        $arg['posts_per_page'] = get_option('posts_per_page');
    }
    if (!isset($arg['post_type'])) {
        $arg['post_type'] = 'post';
    }
    if (get_query_var('paged')) {
        $arg['paged'] = get_query_var('paged');
    }
    //var_dump($args); die();
    //User json encode to "serialize" data, it's much faster
    $json_args = json_encode($arg, 256);
    //If cache is enabled
    if ($cache) {
        //Create cache key
        $cache_id = md5($json_args . $loop_template);
        //Get cache data
        $data = wp_cache_get($cache_id, $group);
        //var_dump($data, $cache_id);
    }
    //Check if we have anything in the cache
    if ($cache && $data) {
        //if we do, return cached data
        return $data;
    }
    $query = new WP_Query($arg);
    $return['data'] = '';
    $return['query'] = $query;
    //Pre fetch users with one query
    //    Clrz_user::bulk($query->posts, 'post_author');
    if ($query->have_posts()) {
        $return['data'] = Partial::getPartial('loop', $loop_template, array('d' => $query), true);
    }
    unset($query);
    wp_reset_query();
    return $return;
}
Пример #2
0
<?php

/**
 * Created by PhpStorm.
 * User: Vilim Stubičan
 * Date: 12.10.2015.
 * Time: 19:18
 */
?>

<section class="knowledge-base">
    <div class="logos-wrapper container">
        <?php 
Partial::getPartial("small", "logos");
?>
    </div>
    <div class="content container">

    </div>
</section>
Пример #3
0
<html <?php 
language_attributes();
?>
 class="no-js">
<head>
	<meta charset="<?php 
bloginfo('charset');
?>
">
	<meta name="viewport" content="width=device-width">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
">

    <link rel="shortcut icon" href="/wp-content/themes/vdl/favicon.ico" type="image/x-icon">
    <link rel="icon" href="/wp-content/themes/vdl/favicon.ico" type="image/x-icon">
    <title>
        <?php 
echo get_bloginfo('name');
?>

    </title>
	<?php 
wp_head();
?>

	<?php 
if (StaticSettings::is_full_main_block_page()) {
    StaticSettings::display_full_main_block_page_code();
Пример #4
0
 public static function display_full_main_block_page_code()
 {
     Partial::getPartial("", "full-height-main-page");
 }
Пример #5
0
<?php

/**
 * Created by PhpStorm.
 * User: Vilim Stubičan
 * Date: 17.7.2015.
 * Time: 13:45
 */
StaticSettings::show_full_main_block_page();
get_header();
?>

<div class="container-block-1 container">
    <div id="particlesBackground"></div>

    <div class="scroll-down-alert">
        <p>
            <?php 
_e('Scroll down', 'vdl');
?>
        </p>
        <i class="fa fa-chevron-down fa-3x"></i>
    </div>
</div>

<?php 
Partial::getPartial("", "knowledge-base");
get_footer();