No Description

functions.php 1021B

    <?php // add any new or customised functions here add_action( 'wp_enqueue_scripts', 'magickbook_enqueue_styles' ); function magickbook_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); // Loads our main stylesheet. wp_enqueue_style( 'spyglass-child-style', get_stylesheet_uri() ); } function magickbook_get_highlighted() { $query = new WP_Query(array('id'=>0)); //empty query if (function_exists('get_featured_posts')) { $posts_array = get_featured_posts(5, 0, 'RAND()*IF( DATEDIFF(CURDATE(),date)<30, DATEDIFF(CURDATE(),date)+1, 30 )'); $query->query( array( 'post_type' => 'any', 'post__in'=>$posts_array, 'ignore_sticky_posts' => 1, 'orderby' => 'post__in' )); } else { $default_cat = get_categories(); $cat = get_theme_mod('mp_slider_cat',$default_cat[0]->cat_ID) ; $args = array('cat' => $cat); $query = new WP_Query($args); } return $query; }