Пример #1
0
 /**
  *
  */
 function miss_get_sidebar()
 {
     wp_reset_query();
     global $wp_query;
     if (is_404()) {
         return;
     }
     $sidebar = true;
     if (is_singular()) {
         $type = get_post_type();
         $post_obj = $wp_query->get_queried_object();
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         if ($_layout == 'full_width') {
             $sidebar = false;
         }
         if ($type == 'portfolio' && empty($_layout)) {
             $sidebar = false;
         }
         if ($template == 'templates/template-wiki.php') {
             $sidebar = false;
         }
         if (strpos($post_obj->post_content, '[portfolio') !== false && empty($_layout)) {
             $sidebar = false;
         }
     }
     if (is_front_page() && !is_active_sidebar('home')) {
         $sidebar = false;
     }
     $sidebar = apply_atomic('get_sidebar', $sidebar);
     if ($sidebar == true) {
         get_sidebar();
     }
 }
Пример #2
0
/**
 * Loads a post content template based off the post type and/or the post format.  This functionality is 
 * not feasible with the WordPress get_template_part() function, so we have to rely on some custom logic 
 * and locate_template().
 *
 * Note that using this function assumes that you're creating a content template to handle attachments. 
 * This filter must be removed since we're bypassing the WP template hierarchy and focusing on templates 
 * specific to the content.
 *
 * @since  1.6.0
 * @access public
 * @return string
 */
function hybrid_get_content_template()
{
    /* Set up an empty array and get the post type. */
    $templates = array();
    $post_type = get_post_type();
    /* Assume the theme developer is creating an attachment template. */
    if ('attachment' == $post_type) {
        remove_filter('the_content', 'prepend_attachment');
    }
    /* If the post type supports 'post-formats', get the template based on the format. */
    if (post_type_supports($post_type, 'post-formats')) {
        /* Get the post format. */
        $post_format = get_post_format() ? get_post_format() : 'standard';
        /* Template based off post type and post format. */
        $templates[] = "content-{$post_type}-{$post_format}.php";
        /* Template based off the post format. */
        $templates[] = "content-{$post_format}.php";
    }
    /* Template based off the post type. */
    $templates[] = "content-{$post_type}.php";
    /* Fallback 'content.php' template. */
    $templates[] = 'content.php';
    /* Apply filters and return the found content template. */
    include apply_atomic('content_template', locate_template($templates, false, false));
}
Пример #3
0
/**
 * Arguments for the wp_list_comments_function() used in comments.php. Users can set up a 
 * custom comments callback function by changing $callback to the custom function.  Note that 
 * $style should remain 'ol' since this is hardcoded into the theme and is the semantically correct
 * element to use for listing comments.
 *
 * @since 0.7.0
 * @access public
 * @return array $args Arguments for listing comments.
 */
function hybrid_list_comments_args()
{
    /* Set the default arguments for listing comments. */
    $args = array('style' => 'ol', 'type' => 'all', 'avatar_size' => 80, 'callback' => 'hybrid_comments_callback', 'end-callback' => 'hybrid_comments_end_callback');
    /* Return the arguments and allow devs to overwrite them. */
    return apply_atomic('list_comments_args', $args);
}
Пример #4
0
/**
 * Used to output title field in search panel
 * 
 * @since 1.2
 * @return string
 * @param string $value
 *
 */
function shandora_search_title_field($value = array(), $class, $is_widget = false)
{
    $o = apply_atomic('search_title_field', '', $value, $class, $is_widget);
    if ($o != '') {
        return $o;
    }
    global $bon;
    $form = $bon->form();
    $o = $form->form_label(__('Title', 'bon'), 'title');
    $o .= $form->form_input('title', $value['title'], 'placeholder="' . __('Type listing title here', 'bon') . '" class="' . $class . '"');
    return apply_atomic('search_title_field_output', $o);
}
Пример #5
0
/**
 * Loads the correct function for handling attachments.  Checks the attachment mime type to call 
 * correct function. Image attachments are not loaded with this function.  The functionality for them 
 * should be handled by the theme's attachment or image attachment file.
 *
 * Ideally, all attachments would be appropriately handled within their templates. However, this could 
 * lead to messy template files.
 *
 * @since 0.5.0
 * @access public
 * @uses get_post_mime_type() Gets the mime type of the attachment.
 * @uses wp_get_attachment_url() Gets the URL of the attachment file.
 * @return void
 */
function hybrid_attachment()
{
    $file = wp_get_attachment_url();
    $mime = get_post_mime_type();
    $mime_type = explode('/', $mime);
    /* Loop through each mime type. If a function exists for it, call it. Allow users to filter the display. */
    foreach ($mime_type as $type) {
        if (function_exists("hybrid_{$type}_attachment")) {
            $attachment = call_user_func("hybrid_{$type}_attachment", $mime, $file);
        }
        $attachment = apply_atomic("{$type}_attachment", $attachment);
    }
    echo apply_atomic('attachment', $attachment);
}
Пример #6
0
 /**
  * Navigation Search Box
  * @since 1.5
  */
 function miss_nav_search_box($items, $args)
 {
     $disable_searchbox = apply_atomic('disable_searchbox', miss_get_setting('disable_searchbox'));
     if (!empty($disable_searchbox)) {
         return $items;
     }
     if ($args->theme_location == 'primary-menu') {
         ob_start();
         get_search_form();
         $searchform = ob_get_contents();
         ob_end_clean();
         $items .= '<li class="nav-search-box">' . $searchform . '<a class="search-button inactive" data-state="inactive">' . __("Search", MISS_TEXTDOMAIN) . '</a></li>';
     }
     return $items;
 }
Пример #7
0
/**
 * Registers JavaScript files for the framework.  This function merely registers scripts with WordPress using
 * the wp_register_script() function.  It does not load any script files on the site.  If a theme wants to register 
 * its own custom scripts, it should do so on the 'wp_enqueue_scripts' hook.
 *
 * @since 1.2.0
 * @access private
 * @return void
 */
function hybrid_register_scripts()
{
    /* Supported JavaScript. */
    $supports = get_theme_support('hybrid-core-scripts');
    /* Use the .min script if SCRIPT_DEBUG is turned off. */
    $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
    /* Register the 'drop-downs' script if the current theme supports 'drop-downs'. */
    if (isset($supports[0]) && in_array('drop-downs', $supports[0])) {
        wp_register_script('drop-downs', esc_url(apply_atomic('drop_downs_script', trailingslashit(HYBRID_JS) . "drop-downs{$suffix}.js")), array('jquery'), '20110920', true);
    }
    /* Register the 'nav-bar' script if the current theme supports 'nav-bar'. */
    if (isset($supports[0]) && in_array('nav-bar', $supports[0])) {
        wp_register_script('nav-bar', esc_url(apply_atomic('nav_bar_script', trailingslashit(HYBRID_JS) . "nav-bar{$suffix}.js")), array('jquery'), '20111008', true);
    }
}
Пример #8
0
					<div id="post-<?php 
        the_ID();
        ?>
" class="<?php 
        hybrid_entry_class();
        ?>
">

						<?php 
        do_atomic('open_entry');
        // trending_open_entry
        ?>

						<?php 
        echo apply_atomic('entry_avatar', get_avatar(get_the_author_meta('user_email'), '100', '', get_the_author_meta('display_name')));
        ?>

						<?php 
        echo apply_atomic_shortcode('entry_title', '[entry-title]');
        ?>

						<?php 
        echo apply_atomic_shortcode('byline', '<div class="byline">' . __('By [entry-author] on [entry-published] [entry-comments-link before=" | "] [entry-edit-link before=" | "]', hybrid_get_textdomain()) . '</div>');
        ?>

						<?php 
        if (has_excerpt()) {
            ?>

							<div class="entry-summary">
Пример #9
0
function shandora_get_search_listing_form($is_widget = false)
{
    global $bon;
    $values = array();
    $values['property_type'] = isset($_COOKIE['property_type']) ? $_COOKIE['property_type'] : '';
    $values['title'] = isset($_COOKIE['title']) ? $_COOKIE['title'] : '';
    $values['property_location'] = isset($_COOKIE['property_location']) ? $_COOKIE['property_location'] : '';
    $values['property_location_level1'] = isset($_COOKIE['property_location_level1']) ? $_COOKIE['property_location_level1'] : '';
    $values['property_location_level2'] = isset($_COOKIE['property_location_level2']) ? $_COOKIE['property_location_level2'] : '';
    $values['property_location_level3'] = isset($_COOKIE['property_location_level3']) ? $_COOKIE['property_location_level3'] : '';
    $values['dealer_location_level1'] = isset($_COOKIE['dealer_location_level1']) ? $_COOKIE['dealer_location_level1'] : '';
    $values['dealer_location_level2'] = isset($_COOKIE['dealer_location_level2']) ? $_COOKIE['dealer_location_level2'] : '';
    $values['dealer_location_level3'] = isset($_COOKIE['dealer_location_level3']) ? $_COOKIE['dealer_location_level3'] : '';
    $values['property_status'] = isset($_COOKIE['property_status']) ? $_COOKIE['property_status'] : '';
    $values['property_bath'] = isset($_COOKIE['property_bath']) ? $_COOKIE['property_bath'] : '';
    $values['property_bed'] = isset($_COOKIE['property_bed']) ? $_COOKIE['property_bed'] : '';
    $values['max_price'] = isset($_COOKIE['max_price']) ? $_COOKIE['max_price'] : '';
    $values['min_price'] = isset($_COOKIE['min_price']) ? $_COOKIE['min_price'] : '';
    $values['max_lotsize'] = isset($_COOKIE['max_lotsize']) ? $_COOKIE['max_lotsize'] : '';
    $values['min_lotsize'] = isset($_COOKIE['min_lotsize']) ? $_COOKIE['min_lotsize'] : '';
    $values['max_buildingsize'] = isset($_COOKIE['max_buildingsize']) ? $_COOKIE['max_buildingsize'] : '';
    $values['min_buildingsize'] = isset($_COOKIE['min_buildingsize']) ? $_COOKIE['min_buildingsize'] : '';
    $values['property_mls'] = isset($_COOKIE['property_mls']) ? $_COOKIE['property_mls'] : '';
    $values['property_zip'] = isset($_COOKIE['property_zip']) ? $_COOKIE['property_zip'] : '';
    $values['property_feature'] = isset($_COOKIE['property_feature']) ? $_COOKIE['property_feature'] : '';
    $values['property_agent'] = isset($_COOKIE['property_agent']) ? $_COOKIE['property_agent'] : '';
    $values['property_floor'] = isset($_COOKIE['property_floor']) ? $_COOKIE['property_floor'] : '';
    $values['property_basement'] = isset($_COOKIE['property_basement']) ? $_COOKIE['property_basement'] : '';
    $values['property_garage'] = isset($_COOKIE['property_garage']) ? $_COOKIE['property_garage'] : '';
    $values['property_mortgage'] = isset($_COOKIE['property_mortgage']) ? $_COOKIE['property_mortgage'] : '';
    $values['reg_number'] = isset($_COOKIE['reg_number']) ? $_COOKIE['reg_number'] : '';
    $values['dealer_location'] = isset($_COOKIE['dealer_location']) ? $_COOKIE['dealer_location'] : '';
    $values['car_feature'] = isset($_COOKIE['car_feature']) ? $_COOKIE['car_feature'] : '';
    $values['body_type'] = isset($_COOKIE['body_type']) ? $_COOKIE['body_type'] : '';
    $values['manufacturer'] = isset($_COOKIE['manufacturer']) ? $_COOKIE['manufacturer'] : '';
    $values['manufacturer_level1'] = isset($_COOKIE['manufacturer_level1']) ? $_COOKIE['manufacturer_level1'] : '';
    $values['manufacturer_level2'] = isset($_COOKIE['manufacturer_level2']) ? $_COOKIE['manufacturer_level2'] : '';
    $values['manufacturer_level3'] = isset($_COOKIE['manufacturer_level3']) ? $_COOKIE['manufacturer_level3'] : '';
    $values['car_status'] = isset($_COOKIE['car_status']) ? $_COOKIE['car_status'] : '';
    $values['fuel_type'] = isset($_COOKIE['fuel_type']) ? $_COOKIE['fuel_type'] : '';
    $values['transmission'] = isset($_COOKIE['transmission']) ? $_COOKIE['transmission'] : '';
    $values['ancap'] = isset($_COOKIE['ancap']) ? $_COOKIE['ancap'] : '';
    $values['min_mileage'] = isset($_COOKIE['min_mileage']) ? $_COOKIE['min_mileage'] : '';
    $values['max_mileage'] = isset($_COOKIE['max_mileage']) ? $_COOKIE['max_mileage'] : '';
    $values['exterior_color'] = isset($_COOKIE['exterior_color']) ? $_COOKIE['exterior_color'] : '';
    $values['interior_color'] = isset($_COOKIE['interior_color']) ? $_COOKIE['interior_color'] : '';
    $values['yearbuilt'] = isset($_COOKIE['yearbuilt']) ? $_COOKIE['yearbuilt'] : '';
    $values['min_yearbuilt'] = isset($_COOKIE['min_yearbuilt']) ? $_COOKIE['min_yearbuilt'] : '';
    $values['max_yearbuilt'] = isset($_COOKIE['max_yearbuilt']) ? $_COOKIE['max_yearbuilt'] : '';
    $output = apply_atomic('search_listing_form', '', $values, $is_widget);
    if (!empty($output)) {
        return $output;
    }
    $button_color = bon_get_option('search_button_color', 'red');
    $form = $bon->form();
    $ro = '<div class="row search-listing-form">';
    // row open
    $rc = '</div>';
    // row close
    $cc = $rc;
    //column close
    if (!$is_widget) {
        $co = '<div class="large-4 column form-column small-11 small-centered large-uncentered">';
        // column open
    } else {
        $co = '<div class="large-12 column form-column small-11 small-centered large-uncentered">';
    }
    $row_1 = bon_get_option('search_row_1');
    $row_2 = bon_get_option('search_row_2');
    $row_3 = bon_get_option('search_row_3');
    $row_count = 3;
    if (!$row_1 && !$row_2 && !$row_3) {
        return '<p style="margin-top: 50px">' . __('Please setup your search fields in Shandora > Theme Settings > Listing Settings > Custom Search Field', 'bon') . '</p>';
    }
    $search_permalink = shandora_get_search_page_url();
    $output = $form->form_open($search_permalink, 'method="get" class="custom" id="search-listing-form"');
    $output .= $ro;
    if (!$is_widget) {
        $output .= '<div class="column large-10 small-12 large-uncentered small-centered">';
    } else {
        $output .= '<div class="column large-12 small-12 large-uncentered small-centered">';
    }
    for ($row_i = 1; $row_i <= $row_count; $row_i++) {
        if (${"row_{$row_i}"}) {
            for ($col_i = 1; $col_i <= 3; $col_i++) {
                if ($col_i == 1) {
                    $output .= $ro;
                }
                $field_type = bon_get_option('search_row_' . $row_i . '_col_' . $col_i);
                if ($field_type != 'none') {
                    $func = "shandora_search_" . $field_type . "_field";
                } else {
                    $func = '';
                }
                $class = '';
                $select_field = array('status', 'location', 'location_level1', 'location_level2', 'location_level3', 'dealer_location_level1', 'dealer_location_level2', 'dealer_location_level3', 'feature', 'mortgage', 'type', 'agent', 'car_status', 'dealer_location', 'body_type', 'car_feature', 'manufacturer', 'transmission', 'manufacturer_level1', 'manufacturer_level2', 'manufacturer_level3', 'yearbuilt', 'fuel_type');
                if (!$is_widget) {
                    if ($row_i >= 3) {
                        $class = 'no-mbot';
                    }
                    if (in_array($field_type, $select_field)) {
                        $class .= ' select-dark';
                    }
                }
                if (function_exists($func)) {
                    $output .= $co;
                    $output .= $func($values, $class, $is_widget);
                    $output .= $cc;
                }
                if ($col_i >= 3) {
                    $output .= $rc;
                }
            }
            if ($col_i < 3) {
                $output .= $rc;
            }
        }
    }
    $output .= $cc;
    $search_label = bon_get_option('search_button_label', __('Find Property', 'bon'));
    if (!$is_widget) {
        $output .= '<div class="column large-2 small-11 large-uncentered small-centered" id="submit-button">';
        $output .= wp_nonce_field('search-panel-submit', 'search_nonce', false, false);
        $output .= $form->form_submit('', $search_label, 'class="button expand small flat ' . $button_color . ' radius"');
    } else {
        $output .= '<div class="column large-12 small-11 large-uncentered small-centered" style="margin-top: 1em;">';
        $output .= wp_nonce_field('search-panel-submit', 'search_nonce', false, false);
        $output .= $form->form_submit('', $search_label, 'class="button small flat ' . $button_color . ' radius"');
    }
    if (defined('ICL_LANGUAGE_CODE')) {
        $output .= '<input type="hidden" name="lang" value="' . ICL_LANGUAGE_CODE . '"/>';
    }
    $permalink_active = get_option('permalink_structure');
    if ($permalink_active == '') {
        $search_page = bon_get_option('search_listing_page');
        $output .= '<input type="hidden" name="page_id" value="' . $search_page . '"/>';
    }
    $output .= $cc . $rc;
    $output .= $form->form_close();
    return $output;
}
 /**
  *
  */
 function portfolio_grid($atts)
 {
     if ($atts == 'generator') {
         $option = array('name' => __('Portfolio Grid', MYSITE_ADMIN_TEXTDOMAIN), 'value' => 'portfolio_grid', 'options' => array(array('name' => __('Number of Columns', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of columns you would like your posts to display in.', MYSITE_ADMIN_TEXTDOMAIN), 'id' => 'column', 'default' => '', 'options' => array('1' => __('One Column', MYSITE_ADMIN_TEXTDOMAIN), '2' => __('Two Column', MYSITE_ADMIN_TEXTDOMAIN), '3' => __('Three Column', MYSITE_ADMIN_TEXTDOMAIN), '4' => __('Four Column', MYSITE_ADMIN_TEXTDOMAIN)), 'type' => 'select'), array('name' => __('Number of Portfolio Posts', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of posts you would like to display on each page.', MYSITE_ADMIN_TEXTDOMAIN), 'id' => 'showposts', 'default' => '', 'options' => array_combine(range(1, 40), array_values(range(1, 40))), 'type' => 'select'), array('name' => __('Portfolio Categories <small>(optional)</small>', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => __('Select which portfolio categories you would like to display.', MYSITE_ADMIN_TEXTDOMAIN), 'id' => 'cat', 'default' => array(), 'target' => 'portfolio_category', 'type' => 'multidropdown'), array('name' => __('Offset Portfolio Posts <small>(optional)</small>', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => __('This will skip a number of posts at the beginning.<br /><br />Useful if you are using multiple portfolio shortcodes on the same page.', MYSITE_ADMIN_TEXTDOMAIN), 'id' => 'offset', 'default' => '', 'options' => array_combine(range(1, 10), array_values(range(1, 10))), 'type' => 'select'), array('name' => __('Fancy Layout <small>(optional)</small>', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => sprintf(__('%1$s comes with an additional fancy portfolio layout.', MYSITE_ADMIN_TEXTDOMAIN), THEME_NAME), 'id' => 'fancy_layout', 'options' => array('true' => __('Enable Fancy Layout', MYSITE_ADMIN_TEXTDOMAIN)), 'default' => '', 'type' => defined('FANCY_PORTFOLIO') ? 'checkbox' : ''), array('name' => __('Disable Portfolio Elements <small>(optional)</small>', MYSITE_ADMIN_TEXTDOMAIN), 'desc' => __('You can hide certain elements from displaying here.', MYSITE_ADMIN_TEXTDOMAIN), 'id' => 'disable', 'options' => array('image' => __('Disable Post Image', MYSITE_ADMIN_TEXTDOMAIN), 'title' => __('Disable Post Title', MYSITE_ADMIN_TEXTDOMAIN), 'excerpt' => __('Disable Post Excerpt', MYSITE_ADMIN_TEXTDOMAIN), 'date' => __('Disable Date', MYSITE_ADMIN_TEXTDOMAIN), 'more' => __('Disable Read More', MYSITE_ADMIN_TEXTDOMAIN), 'visit' => __('Disable Visit Site', MYSITE_ADMIN_TEXTDOMAIN), 'pagination' => __('Disable Pagination', MYSITE_ADMIN_TEXTDOMAIN)), 'default' => '', 'type' => 'checkbox'), 'shortcode_has_atts' => true));
         return $option;
     }
     extract(shortcode_atts(array('column' => '4', 'showposts' => '8', 'cat' => '', 'offset' => '', 'disable' => ''), $atts));
     $out = '';
     $portfolio_query = new WP_Query();
     global $post, $wp_rewrite, $wp_query, $mysite;
     $column = trim($column);
     $showposts = trim($showposts);
     $cat = trim($cat);
     $offset = trim($offset);
     if (is_front_page()) {
         $_layout = mysite_get_setting('homepage_layout');
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $post_obj = $wp_query->get_queried_object();
         $dependencies = get_post_meta($post_obj->ID, '_dependencies', true);
         $dependencies = empty($dependencies) ? get_post_meta($post_obj->ID, '_' . THEME_SLUG . '_dependencies', true) : $dependencies;
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $_layout = empty($_layout) ? 'full_width' : $_layout;
         $images = (strpos($dependencies, 'fancy_portfolio') !== false || apply_atomic('fancy_portfolio', false) == true) && !isset($mysite->responsive) ? 'additional_images' : ($_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images'));
     }
     $paged = mysite_get_page_query();
     $gallery_post = $post->post_name;
     if ($post->post_parent) {
         $parent_query = get_post($post->post_parent);
         $gallery_parent = $parent_query->ID;
     }
     if (is_numeric($offset) && strpos($disable, 'pagination') === false) {
         $mysite->offset = $offset;
         $mysite->posts_per_page = $showposts;
         add_filter('post_limits', 'my_post_limit');
     }
     if (strpos($disable, 'pagination') === false) {
         if (!empty($cat)) {
             $portfolio_query->query(array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'tax_query' => array('relation' => 'IN', array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => explode(',', $cat))), 'offset' => $offset, 'paged' => $paged));
         } else {
             $portfolio_query->query(array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'offset' => $offset, 'paged' => $paged));
         }
     } else {
         if (!empty($cat)) {
             $portfolio_query->query(array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'tax_query' => array('relation' => 'IN', array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => explode(',', $cat))), 'offset' => $offset, 'nopaging' => 0));
         } else {
             $portfolio_query->query(array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'offset' => $offset, 'nopaging' => 0));
         }
     }
     if ($portfolio_query->have_posts()) {
         $img_sizes = $mysite->layout[$images];
         $img_group = 'portfolio_img_group_' . rand(1, 1000);
         $width = '';
         $height = '';
         switch ($column) {
             case 1:
                 $main_class = 'post_grid one_column_portfolio';
                 $width = $img_sizes['one_column_portfolio'][0];
                 $height = $img_sizes['one_column_portfolio'][1];
                 break;
             case 2:
                 $main_class = 'post_grid two_column_portfolio';
                 $column_class = 'one_half';
                 $width = $img_sizes['two_column_portfolio'][0];
                 $height = $img_sizes['two_column_portfolio'][1];
                 break;
             case 3:
                 $main_class = 'post_grid three_column_portfolio';
                 $column_class = 'one_third';
                 $width = $img_sizes['three_column_portfolio'][0];
                 $height = $img_sizes['three_column_portfolio'][1];
                 break;
             case 4:
                 $main_class = 'post_grid four_column_portfolio';
                 $column_class = 'one_fourth';
                 $width = $img_sizes['four_column_portfolio'][0];
                 $height = $img_sizes['four_column_portfolio'][1];
                 break;
         }
         $out .= '<div class="' . $main_class . '">';
         $i = 1;
         while ($portfolio_query->have_posts()) {
             $portfolio_query->the_post();
             $id = get_the_ID();
             $image_id = get_post_thumbnail_id();
             $custom_fields = get_post_custom($id);
             foreach ($custom_fields as $key => $value) {
                 ${$key}[$id] = $value[0];
                 if (is_serialized(${$key}[$id])) {
                     ${$key}[$id] = unserialize(${$key}[$id]);
                 }
             }
             if (has_post_thumbnail() || !empty($_image[$id]) || !empty($_featured_video[$id])) {
                 if (has_post_thumbnail()) {
                     $img = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full', true);
                 } else {
                     $img[0] = !empty($_image[$id]) ? $_image[$id] : '';
                 }
                 if ($wp_rewrite->using_permalinks()) {
                     $url = empty($_custom_link[$id]) ? home_url('/') . 'portfolio/' . $post->post_name . '/gallery/' . $gallery_post . '/' : $_custom_link[$id];
                 } else {
                     $url = htmlspecialchars(add_query_arg(array('gallery' => $gallery_post), get_permalink($id)));
                 }
                 $link_to = empty($_post[$id][0]) ? empty($_featured_video[$id]) ? empty($_image[$id]) ? $img[0] : $_image[$id] : $_featured_video[$id] : $url;
                 $out .= $column != 1 ? '<div class="' . ($i % $column == 0 ? $column_class . ' last' : $column_class) . '">' : '';
                 $out .= '<div class="' . join(' ', get_post_class('post_grid_module', get_the_ID())) . '">';
                 if (strpos($disable, 'image') === false) {
                     $offset = $mysite->layout['images']['image_padding'];
                     $load_width = $width + $offset;
                     $load_height = $height + $offset;
                     $out .= '<div class="post_grid_image" style="width:' . $load_width . 'px;">';
                     ob_start();
                     mysite_portfolio_image_begin();
                     $out .= ob_get_clean();
                     if (empty($img[0]) && !empty($_featured_video[$id])) {
                         $video_check = mysite_video($args = array('url' => $_featured_video[$id], 'parse' => true, 'width' => $width, 'height' => $height));
                     } else {
                         $video_check = false;
                     }
                     if (!empty($video_check)) {
                         $out .= $video_check;
                     } else {
                         $image_tags = mysite_post_image_tags($image_id, $id);
                         $out .= mysite_display_image(array('src' => $img[0], 'alt' => $image_tags['alt'], 'title' => $image_tags['title'], 'height' => $height, 'width' => $width, 'class' => 'hover_fade_js', 'link_to' => $link_to, 'link_class' => 'portfolio_img_load', 'prettyphoto' => empty($_post[$id][0]) ? true : false, 'group' => $img_group, 'preload' => isset($mysite->mobile) ? false : true));
                     }
                     ob_start();
                     mysite_portfolio_image_end(array('column' => $column, 'disable' => $disable, 'more' => !empty($_more[$id][0]) ? $_more[$id][0] : '', 'link' => !empty($_link[$id]) ? $_link[$id] : '', 'url' => $url, 'date' => !empty($_date[$id]) ? $_date[$id] : ''));
                     $out .= ob_get_clean();
                     $out .= '</div>';
                 }
                 $out .= '<div class="post_grid_content">';
                 $out .= apply_filters('mysite_portfolio_date_top', '', array('column' => $column, 'date' => !empty($_date[$id]) ? $_date[$id] : '', 'disable' => $disable));
                 if (strpos($disable, 'title') === false) {
                     $title = empty($_more[$id][0]) ? '<a href="' . esc_url($url) . '">' . get_the_title($id) . '</a>' : get_the_title($id);
                     if ($column == 1 || $column == 2) {
                         $out .= '<h2 class="post_title">' . $title . '</h2>';
                     } else {
                         $out .= '<h3 class="post_title">' . $title . '</h3>';
                     }
                 }
                 if (!empty($_date[$id]) && strpos($disable, 'date') === false) {
                     $out .= apply_filters('mysite_portfolio_date', '<p class="date">' . $_date[$id] . '</p>', array('column' => $column));
                 }
                 if (empty($_more[$id][0]) || !empty($_link[$id]) || !empty($_teaser[$id])) {
                     $out .= '<div class="post_excerpt">';
                     $out .= !empty($_teaser[$id]) && strpos($disable, 'excerpt') === false ? '<p class="portfolio_excerpt">' . do_shortcode($_teaser[$id]) . '</p>' : '';
                     if (empty($_more[$id][0]) || !empty($_link[$id])) {
                         $out .= '<p>';
                         if (empty($_more[$id][0]) && strpos($disable, 'more') === false) {
                             $read_more = '<a href="' . esc_url($url) . '" class="post_more_link portfolio_more">' . __('Read More', MYSITE_TEXTDOMAIN) . '</a>&nbsp;&nbsp;';
                             $out .= apply_filters('mysite_portfolio_read_more', $read_more, esc_url($url));
                         }
                         if (!empty($_link[$id]) && strpos($disable, 'visit') === false) {
                             $visit_site = '<a href="' . esc_url($_link[$id]) . '" class="post_more_link portfolio_link">' . __('Visit Site', MYSITE_TEXTDOMAIN) . '</a>';
                             $out .= apply_filters('mysite_portfolio_visit_site', $visit_site, esc_url($_link[$id]));
                         }
                         $out .= '</p>';
                     }
                     $out .= '</div>';
                 }
                 $out .= '</div>';
                 $out .= '</div>';
                 $out .= $column != 1 ? '</div>' : '';
                 if ($i % $column == 0) {
                     $out .= '<div class="clearboth"></div>';
                 }
                 $i++;
             }
         }
         $out .= '</div>';
         $out .= strpos($disable, 'pagination') === false ? mysite_pagenavi('', '', $portfolio_query) : '';
     } else {
         $out .= __('No portfolio posts were found for the category selected.', MYSITE_TEXTDOMAIN);
     }
     if (is_numeric($offset) && strpos($disable, 'pagination') === false) {
         remove_filter('post_limits', 'my_post_limit');
     }
     wp_reset_query();
     return $out;
 }
Пример #11
0
 * Can be overwritten in a Child theme via {loop-status.php}
 */
if (has_post_format('status')) {
    ?>

			<div class="entry-content">
				<div class="note">
					<a href="<?php 
    the_permalink();
    ?>
" title="<?php 
    the_title_attribute();
    ?>
">
						<?php 
    echo get_avatar(get_the_author_meta('ID'), apply_atomic('status_avatar', '48'));
    ?>
					</a>

					<?php 
    the_content(__('Continue reading <span class="meta-nav">&raquo;</span>', 'cakifo'));
    ?>
				</div>
				<?php 
    wp_link_pages(array('before' => '<p class="page-links">' . __('Pages:', 'cakifo'), 'after' => '</p>'));
    ?>
			</div> <!-- .entry-content -->

		<?php 
    /**
     * Quote, Image or Gallery format
Пример #12
0
/**
 * @since 0.6.0
 * @deprecated 1.0.0
 */
function hybrid_profile_uri()
{
    _deprecated_function(__FUNCTION__, '1.0.0', '');
    echo apply_atomic('profile_uri', 'http://gmpg.org/xfn/11');
}
Пример #13
0
/**
 * Wraps the output of apply_atomic() in a call to do_shortcode(). This allows developers to use 
 * context-aware functionality alongside shortcodes. Rather than adding a lot of code to the 
 * function itself, developers can create individual functions to handle shortcodes.
 *
 * @since 0.7.0
 * @access public
 * @param string $tag Usually the location of the hook but defines what the base hook is.
 * @param mixed $value The value to be filtered.
 * @return mixed $value The value after it has been filtered.
 */
function apply_atomic_shortcode($tag = '', $value = '')
{
    return do_shortcode(apply_atomic($tag, $value));
}
Пример #14
0
/**
 * Get Entry Meta
 *
 * @since 1.3.5
 * @return void
 *
 */
function shandora_listing_entry_meta()
{
    if (isset($_GET['view']) && $_GET['view'] == 'list') {
        return '';
    }
    $meta = shandora_entry_meta();
    echo apply_atomic('listing_entry_meta', $meta);
}
Пример #15
0
/**
 * Custom site title (include logo)
 *
 * @since 0.1.0
 */
function dschool_site_title()
{
    $tag = is_front_page() ? 'h1' : 'div';
    $template_url = get_bloginfo('stylesheet_directory');
    if ($title = get_bloginfo('name')) {
        $title = '<' . $tag . ' id="site-title"><a href="' . home_url() . '" title="' . esc_attr($title) . '" rel="home"><img src="' . $template_url . '/images/logo.png" alt="' . $title . '" /> <span>' . $title . '</span></a></' . $tag . '>';
    }
    echo apply_atomic('site_title', $title);
}
Пример #16
0
/**
 * Arguments for the wp_list_comments_function() used in comments.php. Users can set up a 
 * custom comments callback function by changing $callback to the custom function.  Note that 
 * $style should remain 'ol' since this is hardcoded into the theme and is the semantically correct
 * element to use for listing comments.
 *
 * @since 0.7.0
 * @return array $args Arguments for listing comments.
 */
function hybrid_list_comments_args() {
	$args = array( 'style' => 'ol', 'type' => 'all', 'avatar_size' => 80, 'callback' => 'hybrid_comments_callback', 'end-callback' => 'hybrid_comments_end_callback' );
	return apply_atomic( 'list_comments_args', $args );
}
Пример #17
0
/**
 * Function for handling what the browser/search engine title should be. Tries to handle every 
 * situation to make for the best SEO.
 *
 * @since 0.1
 * @global $wp_query
 */
function hybrid_document_title() {
	global $wp_query;

	$domain = hybrid_get_textdomain();

	$separator = ':';

	if ( is_front_page() && is_home() )
		$doctitle = get_bloginfo( 'name' ) . $separator . ' ' . get_bloginfo( 'description' );

	elseif ( is_home() || is_singular() ) {
		$id = $wp_query->get_queried_object_id();

		$doctitle = get_post_meta( $id, 'Title', true );

		if ( !$doctitle && is_front_page() )
			$doctitle = get_bloginfo( 'name' ) . $separator . ' ' . get_bloginfo( 'description' );
		elseif ( !$doctitle )
			$doctitle = get_post_field( 'post_title', $id );
	}

	elseif ( is_archive() ) {

		if ( is_category() || is_tag() || is_tax() ) {
			$term = $wp_query->get_queried_object();
			$doctitle = $term->name;
		}

		elseif ( is_author() )
			$doctitle = get_the_author_meta( 'display_name', get_query_var( 'author' ) );

		elseif ( is_date () ) {
			if ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'g:i a', $domain ) ) );

			elseif ( get_query_var( 'minute' ) )
				$doctitle = sprintf( __( 'Archive for minute %1$s', $domain ), get_the_time( __( 'i', $domain ) ) );

			elseif ( get_query_var( 'hour' ) )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'g a', $domain ) ) );

			elseif ( is_day() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'F jS, Y', $domain ) ) );

			elseif ( get_query_var( 'w' ) )
				$doctitle = sprintf( __( 'Archive for week %1$s of %2$s', $domain ), get_the_time( __( 'W', $domain ) ), get_the_time( __( 'Y', $domain ) ) );

			elseif ( is_month() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), single_month_title( ' ', false) );

			elseif ( is_year() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'Y', $domain ) ) );
		}
	}

	elseif ( is_search() )
		$doctitle = sprintf( __( 'Search results for &quot;%1$s&quot;', $domain ), esc_attr( get_search_query() ) );

	elseif ( is_404() )
		$doctitle = __( '404 Not Found', $domain );

	/* If paged. */
	if ( ( ( $page = $wp_query->get( 'paged' ) ) || ( $page = $wp_query->get( 'page' ) ) ) && $page > 1 )
		$doctitle = sprintf( __( '%1$s Page %2$s', $domain ), $doctitle . $separator, $page );

	/* Apply the wp_title filters so we're compatible with plugins. */
	$doctitle = apply_filters( 'wp_title', $doctitle, $separator, '' );

	echo apply_atomic( 'document_title', esc_attr( $doctitle ) );
}
Пример #18
0
/**
 *
 */
function miss_enqueue_script()
{
    global $wp_query;
    # Styles array
    $miss_styles = array('prettyphoto' => MISS_PREFIX . '_prettyphoto');
    # Scripts array
    $miss_script = array('comments' => 'comment-reply', 'tabs' => MISS_PREFIX . '_jquery_tools_tabs', 'flexslider' => MISS_PREFIX . '_flexslider', 'form' => MISS_PREFIX . '_jquery_form', 'prettyphoto' => MISS_PREFIX . '_prettyphoto', 'froogaloop2' => MISS_PREFIX . '_froogaloop2', 'custom' => MISS_PREFIX . '_custom');
    $options = get_option(MISS_SETTINGS);
    $slider_type = apply_filters('miss_slider_type', miss_get_setting('homepage_slider'));
    $post_obj = $wp_query->get_queried_object();
    # Front page
    if (is_front_page()) {
        # check widgets for shortcodes
        if (is_active_sidebar('home')) {
            $widget_sc = miss_sc_widget_text();
            if (in_array('flexslider', $widget_sc)) {
                $flex_unset = false;
            }
            if (in_array('tabs', $widget_sc)) {
                $tabs_unset = false;
            }
            # contact form widget is active
            if (is_active_widget(false, false, 'contact_form', true)) {
                $contactform_unset = false;
            }
        }
    }
    # Singular post/page
    if (is_singular()) {
        $dependencies = get_post_meta($post_obj->ID, '_' . THEME_SLUG . '_dependencies', true);
        # check post meta for scripts
        if (strpos($dependencies, 'miss_scripts') === false && ($options['blog_page'] != $post_obj->ID || empty($options['display_full']))) {
            if (strpos($dependencies, 'flexslider') === false) {
                $flex_unset = true;
            }
            if (strpos($dependencies, 'tabs') === false) {
                $tabs_unset = true;
            }
            if (strpos($dependencies, 'contactform') === false) {
                $contactform_unset = true;
            }
        }
        # post comment styles set to tab
        if (apply_atomic('post_comment_styles', $options['post_comment_styles']) == 'tab' && is_single()) {
            $tabs_unset = false;
        }
        # popular/related post set to tab
        if (apply_atomic('post_like_module', $options['post_like_module']) == 'tab' && is_single()) {
            $tabs_unset = false;
        }
    }
    # if search, archive or 404 page
    if (is_archive() || is_search() || is_404()) {
        $flex_unset = true;
        $tabs_unset = true;
        $contactform_unset = true;
    }
    # check text widgets for shortcodes
    if (!is_front_page()) {
        $widget_sc = miss_sc_widget_text();
        if (in_array('flexslider', $widget_sc)) {
            $flex_unset = false;
        }
        if (in_array('tabs', $widget_sc)) {
            $tabs_unset = false;
        }
        # contact form widget is active
        if (is_active_widget(false, false, 'contact_form', true)) {
            $contactform_unset = false;
        }
    }
    # If slider on every page option enabled
    if (apply_filters('miss_slider_page', miss_get_setting('slider_page'))) {
        if ($slider_type == 'flexslider') {
            $flex_unset = false;
        }
    }
    # unset tabs/fading slider
    if (!empty($tabs_unset)) {
        //unset( $miss_script['tabs'] );
        # unset flex
        if (!empty($flex_unset)) {
            unset($miss_script['flexslider']);
        }
    }
    # unset form
    if (!empty($contactform_unset)) {
        unset($miss_script['form']);
    }
    # unset WP comment-reply
    if (!is_singular() || !comments_open() || get_option('thread_comments') != 1) {
        unset($miss_script['comments']);
    }
    # unset buddypress if not exists
    if (!function_exists('bp_is_active')) {
        /* unset bp styles */
        unset($miss_styles['bp_defaults']);
        unset($miss_styles['bp_admin_bar']);
        /* unset bp scripts */
        unset($miss_script["bp"]);
    }
    # Styles filter
    $enqueue_styles = apply_atomic('styles', $miss_styles);
    if (!empty($enqueue_styles)) {
        foreach ($enqueue_styles as $style) {
            wp_enqueue_style($style);
        }
    }
    # Scripts filter
    $enqueue_script = apply_atomic('scripts', $miss_script);
    if (!empty($enqueue_script)) {
        foreach ($enqueue_script as $script) {
            wp_enqueue_script($script);
        }
    }
    //enqueue scripts
    $data = miss_local_assets('assets');
    if (!miss_is_template('templates/template-works.php')) {
        $data = miss_unload_assets($data, 'isotope');
    }
    if (miss_get_setting('responsive') == 'disabled') {
        $data = miss_unload_assets($data, 'responsive');
    }
    if (get_post_type() == 'miss_gallery') {
        wp_register_script('miss_gallery', '' . THEME_JS . '/gallery/init.js', false, null, true);
        wp_register_script('qs', '' . THEME_JS . '/jquery/jquery.quicksand.js', false, null, true);
        wp_register_script('nicescroll', '' . THEME_JS . '/jquery/jquery.nicescroll.js', false, null, true);
        wp_enqueue_script('nicescroll');
        wp_enqueue_script('qs');
    }
    miss_collect_assets($data, $property = 'scripts', $action = 'enqueue');
}
Пример #19
0
" class="<?php 
        hybrid_entry_class();
        ?>
">

						<?php 
        do_atomic('open_loop');
        // Open loop hook
        ?>

						<?php 
        echo apply_atomic_shortcode('entry_utility', '<div class="entry-utility">' . __('[entry-print-link] [entry-email-link] [entry-popup-shortlink]', 'news') . '</div>');
        ?>

						<?php 
        echo apply_atomic('entry_title', the_title('<h1 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h1>', false));
        ?>

						<?php 
        echo apply_atomic_shortcode('byline', '<div class="byline">' . __('By [entry-author] on [entry-published] [entry-terms taxonomy="category" before=" in "] [entry-edit-link before=" | "]', 'news') . '</div>');
        ?>

						<div class="entry-content">
							<?php 
        the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'news'));
        ?>
							<?php 
        wp_link_pages(array('before' => '<p class="page-links">' . __('Pages:', 'news'), 'after' => '</p>'));
        ?>
						</div><!-- .entry-content -->
Пример #20
0
/**
 * Generates meta keywords/tags for the site.
 *
 * @since 0.2.3
 */
function hybrid_meta_keywords() {
	global $wp_query;

	$keywords = '';

	/* If on a single post, check for custom field key Keywords and taxonomies. */
	if ( is_singular() && !is_preview() ) {
		$keywords = get_post_meta( $wp_query->post->ID, 'Keywords', true );

		if ( empty( $keywords ) ) {
			$taxonomies = get_object_taxonomies( $wp_query->post->post_type );

			if ( is_array( $taxonomies ) ) {
				foreach ( $taxonomies as $tax ) {
					if ( $terms = get_the_term_list( $wp_query->post->ID, $tax, '', ', ', '' ) )
						$keywords[] = $terms;
				}
			}

			if ( !empty( $keywords ) )
				$keywords = join( ', ', $keywords );
		}
	}

	/* If we have keywords, join them together into one string and format for output. */
	if ( !empty( $keywords ) )
		$keywords = '<meta name="keywords" content="' . esc_attr( strip_tags( $keywords ) ) . '" />' . "\n";

	echo apply_atomic( 'meta_keywords', $keywords );
}
Пример #21
0
/**
 * Generates meta keywords/tags for the site.
 *
 * @since 0.2.3
 */
function hybrid_meta_keywords()
{
    /* Set an empty $keywords variable. */
    $keywords = '';
    /* If on a singular post and not a preview. */
    if (is_singular() && !is_preview()) {
        /* Get the queried post. */
        $post = get_queried_object();
        /* Get the meta value for the 'Keywords' meta key. */
        $keywords = get_post_meta(get_queried_object_id(), 'Keywords', true);
        /* If no keywords were found. */
        if (empty($keywords)) {
            /* Get all taxonomies for the current post type. */
            $taxonomies = get_object_taxonomies($post->post_type);
            /* If taxonomies were found for the post type. */
            if (is_array($taxonomies)) {
                /* Loop through the taxonomies, getting the terms for the current post. */
                foreach ($taxonomies as $tax) {
                    if ($terms = get_the_term_list(get_queried_object_id(), $tax, '', ', ', '')) {
                        $keywords[] = $terms;
                    }
                }
                /* If keywords were found, join the array into a comma-separated string. */
                if (!empty($keywords)) {
                    $keywords = join(', ', $keywords);
                }
            }
        }
    } elseif (is_author()) {
        /* Get the meta value for the 'Keywords' user meta key. */
        $keywords = get_user_meta(get_query_var('author'), 'Keywords', true);
    }
    /* If we have keywords, format for output. */
    if (!empty($keywords)) {
        $keywords = '<meta name="keywords" content="' . esc_attr(strip_tags($keywords)) . '" />' . "\n";
    }
    echo apply_atomic('meta_keywords', $keywords);
}
Пример #22
0
/**
 * Displays an attachment image's metadata and exif data while viewing a singular attachment page.
 *
 * Note: This function will most likely be restructured completely in the future.  The eventual plan is to 
 * separate each of the elements into an attachment API that can be used across multiple themes.  Keep 
 * this in mind if you plan on using the current filter hooks in this function.
 *
 * @since  0.1.0
 * @access public
 * @return void
 */
function unique_image_info()
{
    /* Set up some default variables and get the image metadata. */
    $meta = wp_get_attachment_metadata(get_the_ID());
    $items = array();
    $list = '';
    /* Add the width/height to the $items array. */
    $items['dimensions'] = sprintf(__('<span class="prep">Dimensions:</span> %s', 'unique'), '<span class="image-data"><a href="' . esc_url(wp_get_attachment_url()) . '">' . sprintf(__('%1$s &#215; %2$s pixels', 'unique'), $meta['width'], $meta['height']) . '</a></span>');
    /* If a timestamp exists, add it to the $items array. */
    if (!empty($meta['image_meta']['created_timestamp'])) {
        $items['created_timestamp'] = sprintf(__('<span class="prep">Date:</span> %s', 'unique'), '<span class="image-data">' . date(get_option('date_format'), $meta['image_meta']['created_timestamp']) . '</span>');
    }
    /* If a camera exists, add it to the $items array. */
    if (!empty($meta['image_meta']['camera'])) {
        $items['camera'] = sprintf(__('<span class="prep">Camera:</span> %s', 'unique'), '<span class="image-data">' . $meta['image_meta']['camera'] . '</span>');
    }
    /* If an aperture exists, add it to the $items array. */
    if (!empty($meta['image_meta']['aperture'])) {
        $items['aperture'] = sprintf(__('<span class="prep">Aperture:</span> %s', 'unique'), '<span class="image-data">' . sprintf(__('f/%s', 'unique'), $meta['image_meta']['aperture']) . '</span>');
    }
    /* If a focal length is set, add it to the $items array. */
    if (!empty($meta['image_meta']['focal_length'])) {
        $items['focal_length'] = sprintf(__('<span class="prep">Focal Length:</span> %s', 'unique'), '<span class="image-data">' . sprintf(__('%s mm', 'unique'), $meta['image_meta']['focal_length']) . '</span>');
    }
    /* If an ISO is set, add it to the $items array. */
    if (!empty($meta['image_meta']['iso'])) {
        $items['iso'] = sprintf(__('<span class="prep">ISO:</span> %s', 'unique'), '<span class="image-data">' . $meta['image_meta']['iso'] . '</span>');
    }
    /* If a shutter speed is given, format the float into a fraction and add it to the $items array. */
    if (!empty($meta['image_meta']['shutter_speed'])) {
        if (1 / $meta['image_meta']['shutter_speed'] > 1) {
            $shutter_speed = '1/';
            if (number_format(1 / $meta['image_meta']['shutter_speed'], 1) == number_format(1 / $meta['image_meta']['shutter_speed'], 0)) {
                $shutter_speed .= number_format(1 / $meta['image_meta']['shutter_speed'], 0, '.', '');
            } else {
                $shutter_speed .= number_format(1 / $meta['image_meta']['shutter_speed'], 1, '.', '');
            }
        } else {
            $shutter_speed = $meta['image_meta']['shutter_speed'];
        }
        $items['shutter_speed'] = sprintf(__('<span class="prep">Shutter Speed:</span> %s', 'unique'), '<span class="image-data">' . sprintf(__('%s sec', 'unique'), $shutter_speed) . '</span>');
    }
    /* Allow devs to overwrite the array of items. */
    $items = apply_atomic('image_info_items', $items);
    /* Loop through the items, wrapping each in an <li> element. */
    foreach ($items as $item) {
        $list .= "<li>{$item}</li>";
    }
    /* Format the HTML output of the function. */
    $output = '<div class="image-info"><h3>' . __('Image Info', 'unique') . '</h3><ul>' . $list . '</ul></div>';
    /* Display the image info and allow devs to overwrite the final output. */
    echo apply_atomic('image_info', $output);
}
Пример #23
0
/**
 * Displays the page's profile URI.
 * @link http://microformats.org/wiki/profile-uris
 *
 * @since 0.6
 */
function hybrid_profile_uri() {
	echo apply_atomic( 'profile_uri', 'http://gmpg.org/xfn/11' );
}
Пример #24
0
/**
 * Used to output property location field in search panel
 * 
 * @since 1.0.6
 * @return string
 * @param string $value
 *
 */
function shandora_search_location_level3_field($value = array(), $class, $is_widget = false)
{
    $o = apply_atomic('search_location_level3_field', '', $value, $class, $is_widget);
    if ($o != '') {
        return $o;
    }
    global $bon;
    $form = $bon->form();
    $loc_opt = array('any' => __('Any', 'bon'));
    if ($value['property_location_level2'] != '') {
        $parent = get_term_by('slug', $value['property_location_level2'], 'property-location');
        if ($parent) {
            $terms = get_terms('property-location', array('parent' => $parent->term_id));
            if ($terms) {
                foreach ($terms as $term) {
                    $loc_opt[$term->slug] = $term->name;
                }
            }
        }
    }
    $o = $form->form_label(bon_get_option('location_level3_label'), 'property_location');
    $o .= $form->form_dropdown('property_location_level3', $loc_opt, $value['property_location_level3'], 'class=" ' . $class . '"');
    return apply_atomic('search_location_level3_field_output', $o);
}
Пример #25
0
/**
 * Dynamic element to wrap the site description in.  If it is the front page, wrap it in an <h2> element.  
 * On other pages, wrap it in a <div> element.
 *
 * @since 0.1.0
 * @access public
 * @return void
 */
function hybrid_site_description()
{
    /* If viewing the front page of the site, use an <h2> tag.  Otherwise, use a <div> tag. */
    $tag = is_front_page() ? 'h2' : 'div';
    /* Get the site description.  If it's not empty, wrap it with the appropriate HTML. */
    if ($desc = get_bloginfo('description')) {
        $desc = sprintf('<%1$s id="site-description"><span>%2$s</span></%1$s>', tag_escape($tag), $desc);
    }
    /* Display the site description and apply filters for developers to overwrite. */
    echo apply_atomic('site_description', $desc);
}
Пример #26
0
/**
 * Function for handling what the browser/search engine title should be. Attempts to handle every 
 * possible situation WordPress throws at it for the best optimization.
 *
 * @since 0.1.0
 * @access public
 * @global $wp_query
 * @return void
 */
function hybrid_document_title()
{
    global $wp_query;
    /* Set up some default variables. */
    $doctitle = '';
    $separator = ':';
    /* If viewing the front page and posts page of the site. */
    if (is_front_page() && is_home()) {
        $doctitle = get_bloginfo('name') . $separator . ' ' . get_bloginfo('description');
    } elseif (is_home() || is_singular()) {
        $doctitle = get_post_meta(get_queried_object_id(), 'Title', true);
        if (empty($doctitle) && is_front_page()) {
            $doctitle = get_bloginfo('name') . $separator . ' ' . get_bloginfo('description');
        } elseif (empty($doctitle)) {
            $doctitle = single_post_title('', false);
        }
    } elseif (is_archive()) {
        /* If viewing a taxonomy term archive. */
        if (is_category() || is_tag() || is_tax()) {
            $doctitle = single_term_title('', false);
        } elseif (is_post_type_archive()) {
            $post_type = get_post_type_object(get_query_var('post_type'));
            $doctitle = $post_type->labels->name;
        } elseif (is_author()) {
            $doctitle = get_user_meta(get_query_var('author'), 'Title', true);
            if (empty($doctitle)) {
                $doctitle = get_the_author_meta('display_name', get_query_var('author'));
            }
        } elseif (is_date()) {
            if (get_query_var('minute') && get_query_var('hour')) {
                $doctitle = sprintf(__('Archive for %1$s', 'hybrid-core'), get_the_time(__('g:i a', 'hybrid-core')));
            } elseif (get_query_var('minute')) {
                $doctitle = sprintf(__('Archive for minute %1$s', 'hybrid-core'), get_the_time(__('i', 'hybrid-core')));
            } elseif (get_query_var('hour')) {
                $doctitle = sprintf(__('Archive for %1$s', 'hybrid-core'), get_the_time(__('g a', 'hybrid-core')));
            } elseif (is_day()) {
                $doctitle = sprintf(__('Archive for %1$s', 'hybrid-core'), get_the_time(__('F jS, Y', 'hybrid-core')));
            } elseif (get_query_var('w')) {
                $doctitle = sprintf(__('Archive for week %1$s of %2$s', 'hybrid-core'), get_the_time(__('W', 'hybrid-core')), get_the_time(__('Y', 'hybrid-core')));
            } elseif (is_month()) {
                $doctitle = sprintf(__('Archive for %1$s', 'hybrid-core'), single_month_title(' ', false));
            } elseif (is_year()) {
                $doctitle = sprintf(__('Archive for %1$s', 'hybrid-core'), get_the_time(__('Y', 'hybrid-core')));
            }
        } else {
            $doctitle = __('Archives', 'hybrid-core');
        }
    } elseif (is_search()) {
        $doctitle = sprintf(__('Search results for &quot;%1$s&quot;', 'hybrid-core'), esc_attr(get_search_query()));
    } elseif (is_404()) {
        $doctitle = __('404 Not Found', 'hybrid-core');
    }
    /* If the current page is a paged page. */
    if ((($page = $wp_query->get('paged')) || ($page = $wp_query->get('page'))) && $page > 1) {
        $doctitle = sprintf(__('%1$s Page %2$s', 'hybrid-core'), $doctitle . $separator, number_format_i18n($page));
    }
    /* Apply the wp_title filters so we're compatible with plugins. */
    $doctitle = apply_filters('wp_title', $doctitle, $separator, '');
    /* Trim separator + space from beginning and end in case a plugin adds it. */
    $doctitle = trim($doctitle, "{$separator} ");
    /* Print the title to the screen. */
    echo apply_atomic('document_title', esc_attr($doctitle));
}
Пример #27
0
<?php

/**
 * The template for displaying Archive pages.
 *
 * @package Omega
 */
get_header();
?>

	<main  class="<?php 
echo apply_atomic('main_class', 'content');
?>
" <?php 
omega_attr('content');
?>
>

		<?php 
do_atomic('before_content');
// omega_before_content
?>

		<?php 
if (have_posts()) {
    ?>

			<header class="page-header">
				<h1 class="archive-title">
					<?php 
    if (is_category()) {
Пример #28
0
}
$bodytype = get_the_term_list($post->ID, 'body-type', '', ', ', '');
$location = get_the_term_list($post->ID, 'dealer-location', '', ', ', '');
$terms = get_the_terms($post->ID, 'manufacturer');
$manufacturer = array();
if ($terms && !is_wp_error($terms)) {
    foreach ($terms as $term) {
        if ($term->parent == '0') {
            $manufacturer[] = '<a href="' . get_term_link($term->term_id, 'manufacturer') . '" title="' . $term->name . '">' . $term->name . '</a>';
        }
    }
}
$manufacturer = implode(', ', $manufacturer);
$details = apply_atomic('car_details_tab_content', array('reg' => __('Reg. Number #', 'bon'), 'location' => __('Dealer Location', 'bon'), 'manufacturer' => __('Manufacturer', 'bon'), 'bodytype' => __('Body Type', 'bon'), 'year' => __('Year Built', 'bon')));
$specs = apply_atomic('car_specifications_tab_content', array('engine' => __('Engine Size', 'bon'), 'enginetype' => __('Engine Type', 'bon'), 'transmission' => __('Transmission', 'bon'), 'mileage' => __('Mileage', 'bon'), 'extcolor' => __('Exterior Color', 'bon'), 'intcolor' => __('Interior Color', 'bon'), 'fuel' => __('Fuel Type', 'bon'), 'status' => __('Status', 'bon'), 'ancap' => __('ANCAP / Safety Rating', 'bon'), 'seating' => __('Standard Seating', 'bon'), 'steering' => __('Steering Type', 'bon')));
$dimension = apply_atomic('car_dimensions_tab_content', array('height' => __('Height', 'bon'), 'width' => __('Width', 'bon'), 'length' => __('Length', 'bon'), 'wheelbase' => __('Wheelbase', 'bon'), 'trackrear' => __('Track Rear', 'bon'), 'trackfront' => __('Track Front', 'bon'), 'ground' => __('Ground Clearance', 'bon')));
?>
<section>
	<nav class="tab-nav">
		<?php 
if (!empty($details) && is_array($details)) {
    ?>
 
		<a class="active" href="#tab-target-details"><?php 
    _e('Details', 'bon');
    ?>
</a>
		<?php 
}
?>
		<?php 
Пример #29
0
/**
 * Function for handling what the browser/search engine title should be. Attempts to handle every 
 * possible situation WordPress throws at it for the best optimization.
 *
 * @since 0.1.0
 * @global $wp_query
 */
function hybrid_document_title() {
	global $wp_query;

	/* Set up some default variables. */
	$domain = hybrid_get_textdomain();
	$doctitle = '';
	$separator = ':';

	/* If viewing the front page and posts page of the site. */
	if ( is_front_page() && is_home() )
		$doctitle = get_bloginfo( 'name' ) . $separator . ' ' . get_bloginfo( 'description' );

	/* If viewing the posts page or a singular post. */
	elseif ( is_home() || is_singular() ) {
		$post_id = $wp_query->get_queried_object_id();

		$doctitle = get_post_meta( $post_id, 'Title', true );

		if ( empty( $doctitle ) && is_front_page() )
			$doctitle = get_bloginfo( 'name' ) . $separator . ' ' . get_bloginfo( 'description' );

		elseif ( empty( $doctitle ) )
			$doctitle = get_post_field( 'post_title', $post_id );
	}

	/* If viewing any type of archive page. */
	elseif ( is_archive() ) {

		/* If viewing a taxonomy term archive. */
		if ( is_category() || is_tag() || is_tax() ) {

			if ( function_exists( 'single_term_title' ) ) {
				$doctitle = single_term_title( '', false );
			} else { // 3.0 compat
				$term = $wp_query->get_queried_object();
				$doctitle = $term->name;
			}
		}

		/* If viewing a post type archive. */
		elseif ( function_exists( 'is_post_type_archive' ) && is_post_type_archive() ) {
			$post_type = get_post_type_object( get_query_var( 'post_type' ) );
			$doctitle = $post_type->labels->name;
		}

		/* If viewing an author/user archive. */
		elseif ( is_author() )
			$doctitle = get_the_author_meta( 'display_name', get_query_var( 'author' ) );

		/* If viewing a date-/time-based archive. */
		elseif ( is_date () ) {
			if ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'g:i a', $domain ) ) );

			elseif ( get_query_var( 'minute' ) )
				$doctitle = sprintf( __( 'Archive for minute %1$s', $domain ), get_the_time( __( 'i', $domain ) ) );

			elseif ( get_query_var( 'hour' ) )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'g a', $domain ) ) );

			elseif ( is_day() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'F jS, Y', $domain ) ) );

			elseif ( get_query_var( 'w' ) )
				$doctitle = sprintf( __( 'Archive for week %1$s of %2$s', $domain ), get_the_time( __( 'W', $domain ) ), get_the_time( __( 'Y', $domain ) ) );

			elseif ( is_month() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), single_month_title( ' ', false) );

			elseif ( is_year() )
				$doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'Y', $domain ) ) );
		}
	}

	/* If viewing a search results page. */
	elseif ( is_search() )
		$doctitle = sprintf( __( 'Search results for &quot;%1$s&quot;', $domain ), esc_attr( get_search_query() ) );

	/* If viewing a 404 not found page. */
	elseif ( is_404() )
		$doctitle = __( '404 Not Found', $domain );

	/* If the current page is a paged page. */
	if ( ( ( $page = $wp_query->get( 'paged' ) ) || ( $page = $wp_query->get( 'page' ) ) ) && $page > 1 )
		$doctitle = sprintf( __( '%1$s Page %2$s', $domain ), $doctitle . $separator, number_format_i18n( $page ) );

	/* Apply the wp_title filters so we're compatible with plugins. */
	$doctitle = apply_filters( 'wp_title', $doctitle, $separator, '' );

	/* Print the title to the screen. */
	echo apply_atomic( 'document_title', esc_attr( $doctitle ) );
}
/**
 * Index Template
 *
 * This is the default template.  It is used when a more specific template can't be found to display
 * posts.  It is unlikely that this template will ever be used, but there may be rare cases.
 *
 * @package MyLife
 * @subpackage Template
 * @since 0.1.0
 * @author Justin Tadlock <*****@*****.**>
 * @copyright Copyright (c) 2011 - 2013, Justin Tadlock
 * @link http://themehybrid.com/themes/my-life
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */
/* Set up some default variables to use in the gallery. */
$gallery_columns = apply_atomic('post_format_archive_gallery_columns', 3);
$gallery_iterator = 0;
get_header();
// Loads the header.php template.
?>

	<?php 
do_atomic('before_content');
// my-life_before_content
?>

	<div id="content">

		<?php 
do_atomic('open_content');
// my-life_open_content