コード例 #1
0
<?php

/**
 * The Template for displaying Archive pages.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme01
 * @since G1_Theme01 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-half-gallery-filterable'));
get_template_part('template-parts/g1_primary_collection', 'one-half-gallery-filterable');
get_footer();
コード例 #2
0
?>

<!-- BEGIN: .g1-collection -->
<div class="<?php 
echo sanitize_html_classes($g1_collection->get_classes());
?>
">
    <ul>
    <?php 
while ($g1_query->have_posts()) {
    $g1_query->the_post();
    ?>
        <li class="g1-collection__item">
        <?php 
    // Our tricky way to pass variables to a template part
    g1_part_set_data(array('collection' => $g1_collection, 'elems' => $g1_elems, 'options' => $g1_options));
    get_template_part('template-parts/g1_content_list_item');
    ?>
        </li>
        <?php 
}
?>
    </ul>
</div>
<!-- END: .g1-collection -->
<?php 
wp_reset_postdata();
?>

<?php 
do_action('g1_collection_after', $g1_collection, $g1_query);
コード例 #3
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_wide_body_class'));
add_filter('body_class', array(G1_Theme(), 'secondary_after_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'two-third', 'summary-type' => 'cut-off'));
get_template_part('template-parts/g1_primary_collection', 'two-third');
?>
    <?php 
get_sidebar();
get_footer();
コード例 #4
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-third-masonry'));
get_template_part('template-parts/g1_primary_collection', 'one-third-masonry');
get_footer();
コード例 #5
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-half'));
get_template_part('template-parts/g1_primary_collection', 'one-half');
get_footer();
コード例 #6
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-fourth-filterable'));
get_template_part('template-parts/g1_primary_collection', 'one-fourth-filterable');
get_footer();
コード例 #7
0
            echo $subtitle;
            ?>
</h3>
                    <?php 
        }
        ?>
                </div>
            </header><!-- .archive-header -->
            <?php 
    }
    ?>

            <?php 
    global $wp_query;
    // Our tricky way to pass variables to a template part
    g1_part_set_data(array('query' => $wp_query, 'collection' => $g1_collection, 'options' => $g1_options, 'elems' => $g1_elems['collection']));
    get_template_part($g1_collection->get_file());
    G1_Pagination()->render();
    ?>
        <?php 
} else {
    ?>
            <?php 
    get_template_part('template-parts/g1_no_results', 'works');
    ?>
        <?php 
}
?>

    </div><!-- #content -->
</div><!-- #primary -->
コード例 #8
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-third-filterable'));
get_template_part('template-parts/g1_primary_collection', 'one-third-filterable');
get_footer();
コード例 #9
0
ファイル: core-tools.php プロジェクト: aragonc/3clicks
 /**
  * Renders the HTML code with the mediabox for the current entry.
  */
 function g1_render_entry_media_box($args)
 {
     $defaults = array('type' => 'list', 'force_placeholder' => true);
     $args = wp_parse_args($args, $defaults);
     if ($args['type'] === true) {
         $args['type'] = 'list';
     }
     extract($args);
     switch ($type) {
         case 'list':
             // Our tricky way to pass variables to a template part
             g1_part_set_data($args);
             get_template_part('template-parts/g1_media_box');
             break;
         case 'featured_media':
         case 'featured-media':
             g1_part_set_data($args);
             get_template_part('template-parts/g1_media_box', 'featured_media');
             break;
         default:
             do_action('g1_mediabox', $args);
     }
 }
コード例 #10
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_wide_body_class'));
add_filter('body_class', array(G1_Theme(), 'secondary_before_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-third-gallery'));
get_template_part('template-parts/g1_primary_collection', 'one-third-gallery');
?>
    <?php 
get_sidebar();
get_footer();
コード例 #11
0
ファイル: shortcodes.php プロジェクト: aragonc/3clicks
 /**
  * Shortcode callback function.
  *
  * @return string
  */
 protected function do_shortcode()
 {
     $default_template = key(G1_Collection_Manager()->get_collection_choices(array('post_type' => $this->get_post_type())));
     extract($this->extract());
     if (!strlen($template)) {
         $template = $default_template;
     }
     $lightbox_group = 'g1-custom-posts-lightbox';
     $out = '';
     $final_id = 'g1-custom-posts-shortcode-' . $this->get_counter();
     $final_class = array('g1-custom-posts-shortcode', 'g1-shortcode');
     $final_class = array_merge($final_class, explode(' ', $class));
     $query = $this->get_query();
     if ($query->have_posts()) {
         // Build config array based on the name of a collection
         $collection = G1_Collection_Manager()->get_collection($template);
         // Add effect
         $collection->add_class('g1-effect-' . sanitize_html_class($effect));
         // Apply custom filters
         $collection = apply_filters('g1_collection_shortcode', $collection, $final_id);
         // Our tricky way to pass variables to a template part
         g1_part_set_data(array('query' => $query, 'collection' => $collection, 'elems' => $this->get_elements()));
         if ($collection) {
             // Capture the template part of our collection
             ob_start();
             get_template_part($collection->get_file());
             $out1 = ob_get_clean();
         } else {
             $out1 = '';
         }
         // Compose the final template
         $out = '<div id="' . esc_attr($final_id) . '" class="' . sanitize_html_classes($final_class) . '">' . $out1 . '</div>';
     }
     return $out;
 }
コード例 #12
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-fourth-gallery'));
get_template_part('template-parts/g1_primary_collection', 'one-fourth-gallery');
get_footer();
コード例 #13
0
<?php

/**
 * The Template for displaying work archive|index.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme03
 * @since G1_Theme03 1.0.0
 */
// Prevent direct script access
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
// Add proper body classes
add_filter('body_class', array(G1_Theme(), 'secondary_none_body_class'));
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'one-fourth-masonry'));
get_template_part('template-parts/g1_primary_collection', 'one-fourth-masonry');
get_footer();
コード例 #14
0
<?php

/**
 * The template for displaying Archive pages.
 *
 * For the full license information, please view the Licensing folder
 * that was distributed with this source code.
 *
 * @package G1_Framework
 * @subpackage G1_Theme01
 * @since G1_Theme01 1.0.0
 */
// Prevent direct script access/
if (!defined('ABSPATH')) {
    die('No direct script access allowed');
}
get_header();
?>
    <?php 
// Our tricky way to pass variables to a template part
g1_part_set_data(array('collection' => 'max', 'summary-type' => 'cut-off'));
get_template_part('template-parts/g1_primary_collection', 'max');
get_footer();