Beispiel #1
0
/**
 * [AJAX] Get the array of categories.
 *
 * @return [JSON] (String) The requested category data.
 */
function ajax_categories()
{
    header('Content-Type: text/javascript');
    $wp_categories = get_categories();
    $response_categories = array();
    foreach ($wp_categories as $category) {
        $response_categories[] = array('ID' => $category->term_id, 'title' => $category->name, 'subtitle' => category_subtitle($category->term_id), 'tagline' => category_tagline($category->term_id), 'parent' => $category->parent, 'size' => $category->count, 'featuredImageURL' => category_featured_image_URL($category->term_id));
    }
    echo json_encode($response_categories);
    die;
}
Beispiel #2
0
    <div class="titlewrap">
        <div class="titleholder">
            <?php 
if (is_home()) {
    ?>
                <video autoplay="true" loop="true" preload="auto" class='titleimage'>
                    <source src="<?php 
    echo get_stylesheet_directory_uri() . '/images/cnect_page_slow.mp4';
    ?>
" type="video/mp4" />
                </video>
            <?php 
} elseif (is_category()) {
    ?>
                <img class="titleimage" src="<?php 
    echo category_featured_image_URL(get_cat_ID(single_cat_title("", false)));
    ?>
">
            <?php 
}
?>
            
        </div>
        <div id="overlay">
            <img src="<?php 
echo get_stylesheet_directory_uri() . '/images/cutout.png';
?>
" class="titleimage">
        </div>

        <span class="titlespan" style="float:left;">