예제 #1
0
파일: taxonomy.php 프로젝트: pdhoopr/wgiki
echo $cat_name;
?>
</h1>
        <p class="entry-description"><?php 
echo $cat_desc;
?>
</p>

        <?php 
$div_tax = $cat_obj->taxonomy;
// Get the taxonomy
$div_type = preg_replace('/_tax/i', '', $div_tax);
// Get the division type
$div_name = preg_replace('/_/i', '-', $div_type);
// Get division name
$resrcs = getCategoryResources($div_type, $div_tax, $cat_obj->term_id);
// Get all resources in this category
/* Loop through all resources for this category */
foreach ($resrcs as $resrc) {
    $resrc_id = $resrc->ID;
    // Get the ID
    $resrc_link = get_permalink($resrc_id);
    // Get the post permalink
    $resrc_targ = '';
    // Set the link target to empty
    $resrc_type = get_field('resource_type', $resrc_id);
    // Get the resource type
    $resrc_file_type = $resrc_type;
    // Get the resource file type
    /* If this is an external link, get the link and open in new window */
    if ($resrc_type == 'external-link') {
예제 #2
0
파일: archive.php 프로젝트: pdhoopr/wgiki
    ?>

        <div class="card-container grid-33 tablet-grid-50 mobile-grid-100">
          <div class="card card-stack card-category">
            <a class="card_link" href="<?php 
    echo $cat_archive;
    ?>
">
              <div class="card_top card_top-<?php 
    echo $div_slug;
    ?>
">
                <i class="fa fa-bookmark"></i>

                <?php 
    $cat_resrc = getCategoryResources($div_type, $div_tax, $cat->term_id);
    // Get resources in this category
    $resrc_count = count($cat_resrc);
    // Get number of resources in this cateogry
    ?>

                <span class="num-items"><i class="fa fa-file-text"></i><?php 
    echo $resrc_count;
    ?>
 resource<?php 
    echo $resrc_count != 1 ? 's' : '';
    ?>
</span>
              </div><!-- .card_top -->
              <div class="card_middle">
                <strong class="card_type">Category</strong>