コード例 #1
0
ファイル: functions.php プロジェクト: chrislafay/cccwd
function get_category_meta($post_id = NULL, $cat_id = NULL)
{
    // Return array
    $final = array();
    // All category IDs
    $categories = wp_get_post_categories($post_id);
    if (isset($categories[0]) || !is_null($cat_id)) {
        $has_category = true;
        // Get the TERM for the category
        if (isset($categories[0])) {
            $term = get_term_by('id', $categories[0], "category");
            $final['cat_id'] = $categories[0];
        } else {
            $term = get_term_by('id', $cat_id, "category");
            $final['cat_id'] = $cat_id;
        }
        // Get all meta data for the Category
        $getTaxMeta = get_tax_meta($term);
        // Grab the Category COLOR
        $cat_color = $getTaxMeta['wish_dish_color'];
        // Append a # to the beginning of the color if it doesn't have one
        if (strpos($cat_color, "#") === false) {
            $cat_color = "#" . $cat_color;
        }
        $final['cat_meta'] = $getTaxMeta;
        $final['cat_color'] = $cat_color;
        $final['cat_bg_image'] = isset($getTaxMeta['wish_dish_image'][0]) ? wp_get_attachment_url($getTaxMeta['wish_dish_image'][0]) : NULL;
        return $final;
    } else {
        return false;
    }
}
コード例 #2
0
function add_price_column_content($value, $column_name, $id)
{
    $price = get_tax_meta($id, 'print_variation_price');
    $priceFormatted = number_format($price, 2, '.', '');
    $symbol = get_woocommerce_currency_symbol();
    return $symbol . $priceFormatted;
}
コード例 #3
0
 public function product_cat_column($columns, $column, $id)
 {
     if ($column == 'icon') {
         $icon = get_tax_meta($id, 'st_icon');
         $columns .= '<i style="font-size:24px" class="' . TravelHelper::handle_icon($icon) . '"></i>';
     }
     return $columns;
 }
コード例 #4
0
ファイル: kdesc.php プロジェクト: b9sk/kdesc
function kdesc_title_tag_rewtite($title)
{
    if (is_category() || is_tag()) {
        $tax_id = is_category() ? get_query_var('cat') : get_query_var('tag_id');
        $title = get_tax_meta($tax_id, 'm_kdesc_title') ? get_tax_meta($tax_id, 'm_kdesc_title') . ' | ' . get_bloginfo('name') : $title;
    }
    return $title;
}
コード例 #5
0
function add_to_context($data)
{
    /* this is where you can add your own data to Timber's context object */
    $categories = get_categories(array('orderby' => 'id'));
    foreach ($categories as $k => $val) {
        $categories[$k]->tipo_projeto = get_tax_meta($val->term_id, 'cda_radio_field_id');
        if (get_tax_meta($val->term_id, 'cda_radio_field_id') == 'conceito') {
            $categories[$k]->tipo_projeto_label = 'Projeto Conceito';
        } else {
            $categories[$k]->tipo_projeto_label = 'Projeto Piloto';
        }
        $categories[$k]->imagem_representativa = get_tax_meta($val->term_id, 'cda_image_field_id');
        $categories[$k]->imagem_representativa['src'] = wp_get_attachment_url($categories[$k]->imagem_representativa['id']);
        $categories[$k]->cor_representativa = get_tax_meta($val->term_id, 'cda_color_field_id');
    }
    $data['categories'] = $categories;
    $data['is_user_logged_in'] = is_user_logged_in();
    $data['current_user'] = wp_get_current_user();
    $data['is_admin'] = is_admin();
    $data['redirect_to'] = 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
    $data['menu'] = new TimberMenu();
    return $data;
}
コード例 #6
0
function dt_geodir_insert_taxonomy($post_type, $catname, $folder_name, $last_catid)
{
    $uploads = wp_upload_dir();
    // Array of key => value pairs
    $dummy_image_url = get_template_directory_uri() . "/assets/images";
    $uploaded = (array) fetch_remote_file("{$dummy_image_url}/cat_icon.png");
    $new_path = null;
    $new_url = null;
    if (empty($uploaded['error'])) {
        $new_path = $uploaded['file'];
        $new_url = $uploaded['url'];
    }
    $wp_filetype = wp_check_filetype(basename($new_path), null);
    $attachment = array('guid' => $uploads['baseurl'] . '/' . basename($new_path), 'post_mime_type' => $wp_filetype['type'], 'post_title' => preg_replace('/\\.[^.]+$/', '', basename($new_path)), 'post_content' => '', 'post_status' => 'inherit');
    $attach_id = wp_insert_attachment($attachment, $new_path);
    // you must first include the image.php file
    // for the function wp_generate_attachment_metadata() to work
    require_once ABSPATH . 'wp-admin/includes/image.php';
    $attach_data = wp_generate_attachment_metadata($attach_id, $new_path);
    wp_update_attachment_metadata($attach_id, $attach_data);
    if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) {
        update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), $post_type);
    }
}
コード例 #7
0
ファイル: custom-css.php プロジェクト: ImtiH/BAPWD
<?php

$category_ids = get_all_category_ids();
if ($category_ids) {
    $cat_css = ' <style> ';
    $cat_js = ' <script> ';
    foreach ($category_ids as $cat_id) {
        $cat_color = get_tax_meta($cat_id, 'pego_category_color');
        if ($cat_color != '') {
            $cat_css .= ' .main-menu .sf-menu > li.menu-cat-item-' . $cat_id . ' > a  { border-top: 5px solid ' . $cat_color . '; } ';
            $cat_css .= ' .main-menu .sf-menu > li.menu-cat-item-' . $cat_id . ' > a:hover, .main-menu  .sf-menu > li.menu-cat-item-' . $cat_id . ' > a:focus, .main-menu .sf-menu > li.menu-cat-item-' . $cat_id . '.sfHover > a,
			
			.main-menu .sf-menu > li.menu-cat-item-' . $cat_id . '.sfHover .submenu_1  
			 { background-color: ' . $cat_color . '; color: #fff; } ';
            $cat_css .= ' .main-menu ul.sf-menu  li.menu-cat-item-' . $cat_id . '.current-menu-item > a,
						  .main-menu ul.sf-menu > li.menu-cat-item-' . $cat_id . '.current-menu-parent > a, 
						  .main-menu ul.sf-menu.cat-color-' . $cat_id . ' > li.menu-cat-item-' . $cat_id . '.current-menu-ancestor > a,
						  .main-menu .sf-menu > li.menu-cat-item-' . $cat_id . ' > a:focus
						  						  { background-color: ' . $cat_color . '; } ';
            //$cat_css .= ' .main-menu .sf-menu > li.menu-cat-item-'.$cat_id.'.sfHover > a { background-color: #fff; color: #000; } ';
            $cat_css .= ' .category-' . $cat_id . ' .main-menu .sf-menu  { border-color: ' . $cat_color . '; } ';
            $cat_css .= ' .category-' . $cat_id . ' .vc_progress_bar .vc_single_bar.bar_blue .vc_bar  { background-color: ' . $cat_color . '; } ';
            $cat_css .= ' .category-' . $cat_id . ' .review-average  { background-color: ' . $cat_color . '; } ';
            $cat_css .= ' .main-menu ul.sf-menu.cat-color-' . $cat_id . ' { border-color: ' . $cat_color . '; } ';
            $cat_css .= ' .category-color-' . $cat_id . ' { color: ' . $cat_color . '; } ';
            $cat_css .= ' .category-bg-color-' . $cat_id . ' { background-color: ' . $cat_color . ' !important; } ';
            $cat_css .= ' .category-hover-color-' . $cat_id . ':hover { color: ' . $cat_color . ' !important; } ';
            $cat_js .= ' 	jQuery(document).ready(function(){
							jQuery(".main-menu .sf-menu > li.menu-cat-item-' . $cat_id . ' > a, .main-menu .sf-menu > li.menu-cat-item-' . $cat_id . ' > .submenu_1").hover(function(){
									jQuery(".main-menu .sf-menu").addClass("cat-color-' . $cat_id . '");
								},function(){
コード例 #8
0
 *
 * @package  WordPress
 * @subpackage  Timber
 * @since    Timber 0.1
 */
$context = Timber::get_context();
$query = array('orderby' => 'meta_value_num', 'order' => 'asc', 'posts_per_page' => 12, 'post_type' => 'avaliacao', 'meta_query' => array(array('key' => 'ordem')));
$context['posts'] = Timber::get_posts($query);
$category_slug = get_query_var('category_name');
$obj_category = get_category_by_slug($category_slug);
$context['step_avaliacao'] = 'step_selected';
$context['show_step_2'] = true;
$context['nome_projeto'] = $obj_category->name;
$context['id_projeto'] = $obj_category->term_id;
$context['slug_projeto'] = $obj_category->slug;
$context['cor_projeto'] = get_tax_meta($obj_category->term_id, 'cda_color_field_id');
$context['username'] = get_query_var('username');
if (get_query_var('username')) {
    $current_user = get_user_by('login', get_query_var('username'));
    $context['profile'] = $current_user;
    $context['compartilhar_imagem'] = get_stylesheet_directory_uri() . '/assets/images/avaliacao_share_facebook_geral.jpg';
} else {
    global $current_user;
    get_currentuserinfo();
    $context['profile'] = $current_user;
    $context['compartilhar_link'] = get_bloginfo('home') . '/projetos/' . $category_slug . '/' . $current_user->user_login;
}
if ($_GET['answered'] == 1) {
    $context['mensagem'] = 'Você já deu sua opnião sobre esse projeto. Nevegue pelos outros para contribuir mais.';
}
$time = current_time('mysql');
コード例 #9
0
ファイル: listing-preview.php プロジェクト: bangjojo/wp
$term_icon = '';
if (!empty($post->post_category)) {
    foreach ($post->post_category as $post_taxonomy => $post_term) {
        if ($post_term != '' && !is_array($post_term)) {
            $post_term = explode(',', trim($post_term, ','));
        }
        $post_term = array_unique($post_term);
        if (!empty($post_term)) {
            foreach ($post_term as $cat_id) {
                $cat_id = trim($cat_id);
                if ($cat_id != '') {
                    /*if($term_icon_url = get_tax_meta($cat_id,'ct_cat_icon'))
                      $term_icon = $term_icon_url['src'];*/
                    $term_icon = get_option('geodir_default_marker_icon');
                    if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
                        if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
                            if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
                                $term_icon = $term_icon_url['src'];
                            }
                            break;
                        }
                    }
                }
            }
        }
    }
}
$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
$srcharr = array("'", "/", "-", '"', '\\');
$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
コード例 #10
0
include get_stylesheet_directory() . "/css/layout.php";
wp_head();
// Include custom header stuff if there is any (haven't thoroughly tested this escaping)
if ($wipHeadMeta) {
    $allowedHeaderTags = array('link' => array('href' => array(), 'rel' => array(), 'type' => array(), 'media' => array()), 'style' => array('type' => array(), 'media' => array()), 'script' => array('type' => array(), 'src' => array()));
    echo wp_kses($wipHeadMeta, $allowedHeaderTags);
}
// If navigation override is in place
$categories = get_the_category();
foreach ($categories as $category) {
    $categoryID = $category->cat_ID;
    if (get_tax_meta($categoryID, 'navOverride')) {
        echo '<script language="JavaScript" type="text/javascript">var navcurrentpage="' . get_tax_meta($categoryID, 'navOverride') . '";</script>';
    }
    if ((is_category($categoryID) || in_category($categoryID)) && get_tax_meta($categoryID, 'customCSS')) {
        echo '<link rel="stylesheet" href="' . get_tax_meta($categoryID, 'customCSS') . '" type="text/css" media="all" />';
    }
}
?>
		<script type="text/javascript"> Shadowbox.init(); </script>
	</head>
	<body<?php 
if ($wipBodyMeta) {
    echo ' ' . esc_attr($wipBodyMeta);
}
/* Include custom body attribute stuff if there is any*/
?>
>

<?php 
if (!defined('CAHNRSANALYTICS')) {
コード例 #11
0
						<div class="form-group">
							<label for="title">Τίτλος</label>
							<input type="text" class="form-control" id="title" name="title" placeholder="Τίτλος της Ιδέας">
						</div>
						
						<div class="form-group">
							<label for="ideacat">Κύκλος Υποβολής</label>
							<?php 
            if ($call != 0) {
                echo '<input type="text" class="form-control" id="idea_cat" name="idea_cat_dummy" value="' . $call_name . '" disabled="disabled" />';
                echo '<input type="hidden" id="title" name="idea_cat" value="' . $call . '" />';
            } else {
                echo '<select name="idea_cat" id="idea_cat" class="form-control" tabindex="4"> ';
                $catz = get_terms('idea_cat', array('hide_empty' => false));
                foreach ($catz as $cat) {
                    $is_active = get_tax_meta($cat->term_id, 'opengov_is_active');
                    if ($is_active) {
                        $selected = '';
                        if ($call != 0 and $cat->term_id == $call) {
                            $selected = 'selected="selected"';
                        }
                        echo '<option class="level-0" value="' . $cat->term_id . '" ' . $selected . '>' . $cat->name . '</option>';
                    }
                }
                echo '</select>';
            }
            ?>
							
						</div>
						
						<div class="form-group">
コード例 #12
0
/**
 * Adds meta keywords and description for SEO.
 *
 * @since 1.0.0
 * @since 1.5.4 Modified to replace %location% from meta when Yoast SEO plugin active.
 * @package GeoDirectory
 * @global object $wpdb WordPress Database object.
 * @global object $post The current post object.
 * @global object $wp_query WordPress Query object.
 * @global array $geodir_addon_list List of active GeoDirectory extensions.
 */
function geodir_add_meta_keywords()
{
    global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
    $is_geodir_page = geodir_is_geodir_page();
    if (!$is_geodir_page) {
        return;
    }
    // if non GD page, bail
    $use_gd_meta = true;
    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
        $use_gd_meta = false;
        if (geodir_is_page('search')) {
            $use_gd_meta = true;
        }
    }
    if (!$use_gd_meta) {
        return;
    }
    // bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active.
    $current_term = $wp_query->get_queried_object();
    $all_postypes = geodir_get_posttypes();
    $geodir_taxonomies = geodir_get_taxonomies('', true);
    $meta_desc = '';
    $meta_key = '';
    if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
        /**
         * Filter SEO meta location description.
         *
         * @since 1.0.0
         */
        $meta_desc = apply_filters('geodir_seo_meta_location_description', '');
        $meta_desc .= '';
    }
    if (have_posts() && is_single() or is_page()) {
        while (have_posts()) {
            the_post();
            if (has_excerpt()) {
                $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
                if (empty($out_excerpt)) {
                    $out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
                }
                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
            } else {
                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
                $out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
                if (empty($out_excerpt)) {
                    $out_excerpt = strip_tags(do_shortcode($out_excerpt));
                    // parse short code from content
                }
                $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
            }
            $meta_desc .= $out_excerpt;
        }
    } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
        if (is_category()) {
            $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
        } elseif (is_tag()) {
            $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
        }
    } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
        $meta_desc .= isset($current_term->description) ? $current_term->description : '';
    }
    $geodir_post_type = geodir_get_current_posttype();
    $geodir_post_type_info = get_post_type_object($geodir_post_type);
    $geodir_is_page_listing = geodir_is_page('listing') ? true : false;
    $category_taxonomy = geodir_get_taxonomies($geodir_post_type);
    $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true);
    $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
    $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
    $geodir_is_search = geodir_is_page('search') ? true : false;
    $geodir_is_location = geodir_is_page('location') ? true : false;
    $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && ($geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false);
    $godir_location_terms = geodir_get_current_location_terms('query_vars');
    $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL;
    $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL;
    $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL;
    $replace_location = __('Everywhere', 'geodirectory');
    $location_id = NULL;
    if ($geodir_location_manager) {
        $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
        $location_id = (int) $wpdb->get_var($sql);
        $location_type = geodir_what_is_current_location();
        if ($location_type == 'city') {
            $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
        } elseif ($location_type == 'region') {
            $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
        } elseif ($location_type == 'country') {
            $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
            $replace_location = __($replace_location, 'geodirectory');
        }
        $country = get_query_var('gd_country');
        $region = get_query_var('gd_region');
        $city = get_query_var('gd_city');
        $current_location = '';
        if ($country != '') {
            $current_location = get_actual_location_name('country', $country, true);
        }
        if ($region != '') {
            $current_location = get_actual_location_name('region', $region);
        }
        if ($city != '') {
            $current_location = get_actual_location_name('city', $city);
        }
        $replace_location = $current_location != '' ? $current_location : $replace_location;
    }
    $geodir_meta_keys = '';
    $geodir_meta_desc = '';
    if ($is_geodir_page && !empty($geodir_post_type_info)) {
        if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
            $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
            $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
            $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
            if ($geodir_is_category) {
                $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
                if (isset($category->term_id) && !empty($category->term_id)) {
                    $category_id = $category->term_id;
                    $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
                    if ($location_id) {
                        $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
                        $cat_loc_option = get_option($option_name);
                        $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
                        if (!$gd_cat_loc_default) {
                            $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
                            $option = get_option($option_name);
                            $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
                        }
                    }
                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
                }
            } else {
                if ($geodir_is_tag) {
                    $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
                }
            }
        }
    }
    $gd_page = '';
    if (geodir_is_page('home')) {
        $gd_page = 'home';
        $meta_desc = get_option('geodir_meta_desc_homepage') ? get_option('geodir_meta_desc_homepage') : $meta_desc;
    } elseif (geodir_is_page('detail')) {
        $gd_page = 'detail';
        $meta_desc = get_option('geodir_meta_desc_detail') ? get_option('geodir_meta_desc_detail') : $meta_desc;
    } elseif (geodir_is_page('pt')) {
        $gd_page = 'pt';
        $meta_desc = get_option('geodir_meta_desc_pt') ? get_option('geodir_meta_desc_pt') : $meta_desc;
    } elseif (geodir_is_page('listing')) {
        $gd_page = 'listing';
        $meta_desc = get_option('geodir_meta_desc_listing') ? get_option('geodir_meta_desc_listing') : $meta_desc;
    } elseif (geodir_is_page('location')) {
        $gd_page = 'location';
        $meta_desc = get_option('geodir_meta_desc_location') ? get_option('geodir_meta_desc_location') : $meta_desc;
        $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
    } elseif (geodir_is_page('search')) {
        $gd_page = 'search';
        $meta_desc = get_option('geodir_meta_desc_search') ? get_option('geodir_meta_desc_search') : $meta_desc;
    } elseif (geodir_is_page('add-listing')) {
        $gd_page = 'add-listing';
        $meta_desc = get_option('geodir_meta_desc_add-listing') ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
    } elseif (geodir_is_page('author')) {
        $gd_page = 'author';
        $meta_desc = get_option('geodir_meta_desc_author') ? get_option('geodir_meta_desc_author') : $meta_desc;
    } elseif (geodir_is_page('login')) {
        $gd_page = 'login';
        $meta_desc = get_option('geodir_meta_desc_login') ? get_option('geodir_meta_desc_login') : $meta_desc;
    } elseif (geodir_is_page('listing-success')) {
        $gd_page = 'listing-success';
        $meta_desc = get_option('geodir_meta_desc_listing-success') ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
    }
    /*
    $geodir_meta_desc = $geodir_meta_desc != '' ? $geodir_meta_desc : $meta_desc;
    if ($geodir_meta_desc != '') {
        $geodir_meta_desc = strip_tags($geodir_meta_desc);
        $geodir_meta_desc = esc_html($geodir_meta_desc);
        $geodir_meta_desc = wp_html_excerpt($geodir_meta_desc, 1000, '.');
        $geodir_meta_desc = isset($replace_location) ? str_replace('%location%', $replace_location, $geodir_meta_desc) : $geodir_meta_desc;
    
        $meta_desc = $geodir_meta_desc != '' ? $geodir_meta_desc : $meta_desc;
    }
    */
    if ($meta_desc) {
        $meta_desc = stripslashes_deep($meta_desc);
        /**
         * Filter page description to replace variables.
         *
         * @since 1.5.4
         * @param string $title The page description including variables.
         * @param string $gd_page The GeoDirectory page type if any.
         */
        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
        /**
         * Filter SEO meta description.
         *
         * @since 1.0.0
         * @param string $meta_desc Meta description content.
         */
        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
    }
    // meta keywords
    if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
        $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
        $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
        $meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
    } else {
        $posttags = get_the_tags();
        if ($posttags) {
            foreach ($posttags as $tag) {
                $meta_key .= $tag->name . ' ';
            }
        } else {
            $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
            $xt = 1;
            foreach ($tags as $tag) {
                if ($xt <= 20) {
                    $meta_key .= $tag->name . ", ";
                }
                $xt++;
            }
        }
    }
    $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
    $geodir_meta_keys = $geodir_meta_keys != '' ? $meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys : $meta_key;
    if ($geodir_meta_keys != '') {
        $geodir_meta_keys = strip_tags($geodir_meta_keys);
        $geodir_meta_keys = esc_html($geodir_meta_keys);
        $geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
        $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
        $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
        $meta_key = rtrim(trim($geodir_meta_keys), ",");
    }
    if ($meta_key) {
        $meta_key = stripslashes_deep($meta_key);
        /**
         * Filter SEO meta keywords.
         *
         * @since 1.0.0
         * @param string $meta_desc Meta keywords.
         */
        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
    }
}
コード例 #13
0
<div class="sideitem grey">

<?php 
//Get the correct taxonomy ID by slug
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
//Get Taxonomy Meta
$saved_data = get_tax_meta($term->term_id, 'ba_text_field_id');
?>

<div class="commonname">
	<b>Common Name:</b> 
	<?php 
if (!empty($saved_data)) {
    echo $saved_data;
} else {
    the_title();
}
?>
</div><!-- common name -->

<div class="taxonomy-item">
<div class="all-classifications">

<div class="thelionking">
	<h2>Classification</h2>

	<div class="class-row">
		<div class="left-classif">Kingdom: </div> 
		<div class="right-classif" id="kingdom"><?php 
echo get_the_term_list($post->ID, 'kingdomtag');
?>
コード例 #14
0
ファイル: attribute.php プロジェクト: DaddyFool/travelTest
            echo esc_attr($font_size);
            ?>
>

                <ul class="booking-item-features booking-item-features-expand mb30 clearfix">
                    <?php 
            foreach ($terms as $key2 => $value2) {
                ?>
                        <li class="<?php 
                if ($item_col) {
                    echo 'col-sm-' . $item_col;
                }
                ?>
">
                            <?php 
                if (function_exists('get_tax_meta') and $icon = get_tax_meta($value2->term_id, 'st_icon')) {
                    ?>
                                <i class="<?php 
                    echo TravelHelper::handle_icon($icon);
                    ?>
"></i>
                            <?php 
                }
                ?>
                            <span class="booking-item-feature-title"><?php 
                echo esc_html($value2->name);
                ?>
</span>
                        </li>
                    <?php 
            }
コード例 #15
0
ファイル: case-links.php プロジェクト: JeppeSigaard/smamo16
<?php

$terms = get_terms('cases', array('hide_empty' => false));
?>
<section class="case-links">
    <div class="inner">
        <?php 
$i = 0;
foreach ($terms as $term) {
    $i++;
    if ($i < 3) {
        ?>
        <?php 
        $term_img = get_tax_meta($term->term_id, 'case_type_img', true);
        ?>
        <a href="<?php 
        echo get_term_link($term->term_id, 'cases');
        ?>
" class="case-link loading" data-bg="<?php 
        echo $term_img['url'];
        ?>
">
            <h3 class="case-link-title"><?php 
        echo $term->name;
        ?>
</h3>
        </a>
        <?php 
    }
}
?>
コード例 #16
0
                                if (!empty($v_info['cars_equipment_taxonomy_id'])) {
                                    if ($v->term_id == $v_info['cars_equipment_taxonomy_id']) {
                                        $dk_check = true;
                                        $data_info = $v_info['cars_equipment_taxonomy_info'];
                                        $data_title_info = "";
                                        if (!empty($v_info['title'])) {
                                            $data_title_info = $v_info['title'];
                                        }
                                    }
                                }
                            }
                        }
                        if ($i < $limit) {
                            if ($dk_check == true) {
                                echo '<li title="" data-placement="top" rel="tooltip" data-original-title="' . $data_title_info . '">
                                                                        <i class="' . TravelHelper::handle_icon(get_tax_meta($v->term_id, 'st_icon', true)) . '"></i>
                                                                        <span class="booking-item-feature-sign">' . $data_info . '</span>
                                                                    </li>';
                            } else {
                                /*echo '<li title="" data-placement="top" rel="tooltip" data-original-title="'.esc_html($v->name).'">
                                        <i class="'.TravelHelper::handle_icon(get_tax_meta($v->term_id, 'st_icon',true)).'"></i>
                                  </li>';*/
                            }
                        }
                        $i++;
                    }
                }
            }
        }
    }
}
コード例 #17
0
    foreach ($terms as $term) {
        $term_link = get_term_link($term);
        // If there was an error, continue to the next term.
        if (is_wp_error($term_link)) {
            continue;
        }
        ?>
				
				<div class="media-object">
					<a href="<?php 
        echo esc_url($term_link);
        ?>
">
						<div class="media-object-media">
							<?php 
        $saved_data = get_tax_meta($term->term_id, 'mbd_thumb_image_field_id', true);
        $attachment_id = $saved_data['id'];
        echo wp_get_attachment_image($attachment_id, 'full');
        ?>
											
						</div><!-- .media-object-media -->
						<article class="media-object-content">
							<header><span><?php 
        echo $term->name;
        ?>
</span></header>
						</article><!-- .media-object-content -->
					</a>
				</div><!-- .media-object -->
				<?php 
    }
コード例 #18
0
ファイル: core.php プロジェクト: TechDevMX/BlogJivamukti
    function cb_related_posts_block()
    {
        global $post;
        $cb_post_id = $post->ID;
        $i = 1;
        $cb_related_posts_amount = floatval(ot_get_option('cb_related_posts_amount', '2'));
        $cb_related_posts_show = ot_get_option('cb_related_posts_show', 'both');
        $cb_related_posts_order = ot_get_option('cb_related_posts_order', 'rand');
        $cb_blog_style = ot_get_option('cb_related_posts_style', '2');
        $cb_related_posts_amount_full = $cb_related_posts_amount * 1.5;
        $cb_block_title = __('Related Articles', 'cubell');
        $cb_classes = 'cb-row-article clearfix cb-blog-style';
        if ($cb_blog_style == 1) {
            $cb_posts_per_row = 1;
            $cb_width = '1400';
            $cb_height = '580';
            $cb_classes .= ' cb-row-1';
        }
        if ($cb_blog_style == 2) {
            $cb_posts_per_row = 2;
            $cb_width = '800';
            $cb_height = '550';
            $cb_classes .= ' cb-row-2';
        }
        if ($cb_blog_style == 3) {
            $cb_posts_per_row = 3;
            $cb_width = '550';
            $cb_height = '430';
            $cb_classes .= ' cb-row-3';
        }
        $cb_full_width_post = get_post_meta($cb_post_id, 'cb_full_width_post', true);
        if ($cb_full_width_post == 'nosidebar') {
            $cb_number_related = $cb_related_posts_amount_full;
        } else {
            $cb_number_related = $cb_related_posts_amount;
        }
        $cb_tags = wp_get_post_tags($cb_post_id);
        $cb_tag_check = $cb_all_cats = $cb_related_args = $cb_related_posts = NULL;
        if ($cb_related_posts_show == 'both' || $cb_related_posts_show == 'tags') {
            if ($cb_tags != NULL) {
                foreach ($cb_tags as $cb_tag) {
                    $cb_tag_check .= $cb_tag->slug . ',';
                }
                $cb_related_args = array('numberposts' => $cb_number_related, 'tag' => $cb_tag_check, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => $cb_related_posts_order);
                $cb_related_posts = get_posts($cb_related_args);
            }
        }
        if ($cb_related_posts_show == 'both' || $cb_related_posts_show == 'cats') {
            if ($cb_related_posts == NULL) {
                $cb_categories = get_the_category();
                foreach ($cb_categories as $cb_category) {
                    $cb_all_cats .= $cb_category->term_id . ',';
                }
                $cb_related_args = array('numberposts' => $cb_number_related, 'category' => $cb_all_cats, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => $cb_related_posts_order);
                $cb_related_posts = get_posts($cb_related_args);
            }
        }
        if ($cb_related_posts != NULL) {
            echo '<div id="cb-related-posts" class="clearfix"><h3 class="cb-tags-title cb-body-font cb-footer-title">' . $cb_block_title . '</h3>';
            foreach ($cb_related_posts as $post) {
                $cb_post_id = $post->ID;
                $cb_global_color = ot_get_option('cb_base_color', '#eb9812');
                $cb_cat_id = get_the_category();
                if (function_exists('get_tax_meta')) {
                    $cb_current_cat_id = $cb_cat_id[0]->term_id;
                    $cb_category_color = get_tax_meta($cb_current_cat_id, 'cb_color_field_id');
                    if ($cb_category_color == "#" || $cb_category_color == NULL) {
                        $cb_parent_cat_id = $cb_cat_id[0]->parent;
                        if ($cb_parent_cat_id != '0') {
                            $cb_category_color = get_tax_meta($cb_parent_cat_id, 'cb_color_field_id');
                        }
                        if ($cb_category_color == "#" || $cb_category_color == NULL) {
                            $cb_category_color = $cb_global_color;
                        }
                    }
                } else {
                    $cb_category_color = NULL;
                }
                setup_postdata($post);
                ?>
                    <article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class($cb_classes);
                ?>
 role="article">

                        <div class="cb-article-area">
                            <div class="cb-mask">
                                <?php 
                cb_thumbnail($cb_post_id, $cb_width, $cb_height);
                ?>
                            </div>
                            <?php 
                cb_post_meta_wrap($cb_post_id, $cb_like_count = 'on');
                ?>
                        </div>

                    </article>
    <?php 
                $i++;
            }
            echo '</div>';
            wp_reset_postdata();
        }
    }
コード例 #19
0
                                        <div class="row">
                                            <div class="col-md-3">
                                                <div class="checkbox-inline checkbox-stroke">
                                                    <label for="check_all">
                                                        <i class="fa fa-cogs"></i>
                                                        <input name="check_all" class="i-check check_all"
                                                               type="checkbox"/><?php 
            _e("All", ST_TEXTDOMAIN);
            ?>
                                                    </label>
                                                </div>
                                            </div>
                                            <?php 
            foreach ($category as $k => $v) {
                $icon = get_tax_meta($k, 'st_icon');
                $icon = TravelHelper::handle_icon($icon);
                $check = '';
                if (STUser_f::st_check_post_term_partner($post_id, $value, $k) == true) {
                    $check = 'checked';
                }
                ?>
                                                <div class="col-md-3">
                                                    <div class="checkbox-inline checkbox-stroke">
                                                        <label for="taxonomy">
                                                            <i class="<?php 
                echo esc_html($icon);
                ?>
"></i>
                                                            <input name="taxonomy[]" class="i-check item_tanoxomy"
                                                                   type="checkbox" <?php 
コード例 #20
0
// for category customization
require_once "Tax-meta-class/Tax-meta-class.php";
global $current_user;
get_currentuserinfo();
/*
* configure taxonomy custom fields
*/
$configt = array('id' => 'categ_meta_box', 'title' => 'Category options', 'pages' => array('category'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true);
/*
* Initiate your taxonomy custom fields
*/
$custom_category = new Tax_Meta_Class($configt);
/*
* Add fields
*/
//Categories image
$custom_category->addImage('categ_img', array('name' => __('Download an image for your category', 'iftheme')));
//Display children checkbox
$custom_category->addCheckbox('categ_children', array('name' => __('Display sub-categories', 'iftheme'), 'desc' => __("Check this box if you want to display a list of child categories", 'iftheme')));
//Display children checkbox
$check = true;
if (isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'category') {
    $check = isset($_GET['tag_ID']) ? get_tax_meta($_GET['tag_ID'], 'categ_posts') : true;
}
$custom_category->addCheckbox('categ_posts', array('name' => __('Display Posts', 'iftheme'), 'desc' => __("Check this box if you want to display a list of the category's posts", 'iftheme'), 'std' => $check));
//hidden field
//to avoid conflict with wpml plugin
//global $current_user; get_currentuserinfo();
//$custom_category->addHidden('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
//$custom_category->addText('cur_user',array('name'=> 'current user', 'std'=>$current_user->ID));
$custom_category->Finish();
コード例 #21
0
ファイル: woocommerce.php プロジェクト: hikaram/wee
    function kt_category_slider()
    {
        if (!is_plugin_active('kutetheme-toolkit/kutetheme-toolkit.php')) {
            //plugin is activated
            return false;
        }
        $cate = get_queried_object();
        $cateID = $cate->term_id;
        $category_slider = get_tax_meta($cateID, 'kt_category_slider');
        if ($category_slider) {
            $list_image = explode('|', $category_slider['url']);
            if (count($list_image) > 1) {
                ?>
                <div class="category-slider">
                    <ul class="owl-carousel owl-style2" data-dots="false" data-loop="true" data-nav = "true" data-autoplay="true" data-items="1">
                        <?php 
                foreach ($list_image as $url) {
                    ?>
                            <li>
                                <img src="<?php 
                    echo esc_url($url);
                    ?>
" alt="category-slider" />
                            </li>
                            <?php 
                }
                ?>
                    </ul>
                </div>
            <?php 
            } elseif (count($list_image) > 0) {
                ?>
                <div class="category-slider">
                    <ul>
                        <?php 
                foreach ($list_image as $url) {
                    ?>
                            <li>
                                <img src="<?php 
                    echo esc_url($url);
                    ?>
" alt="category-slider" />
                            </li>
                            <?php 
                }
                ?>
                    </ul>
                </div>
                <?php 
            }
        }
    }
コード例 #22
0
function bpxl_stylesheets()
{
    global $bpxl_goblog_options;
    wp_enqueue_style('goblog-style', get_stylesheet_uri());
    // Color Scheme
    if (is_single()) {
        if (is_attachment()) {
            $category_ID = '';
        } else {
            $category = get_the_category();
            $category_ID = $category[0]->cat_ID;
        }
    } elseif (is_category()) {
        $category_ID = get_query_var('cat');
    }
    if (is_single() || is_category()) {
        $bpxl_cat_color_1 = get_tax_meta($category_ID, 'bpxl_color_field_id');
        $cat_bg = get_tax_meta($category_ID, 'bpxl_bg_field_id');
        $cat_repeat = get_tax_meta($category_ID, 'bpxl_category_repeat_id');
        $cat_attachment = get_tax_meta($category_ID, 'bpxl_background_attachment_id');
        $cat_position = get_tax_meta($category_ID, 'bpxl_background_position_id');
    }
    // Color Scheme 1
    $color_scheme_1 = "";
    if (is_single() || is_category()) {
        if (strlen($bpxl_cat_color_1) > 2) {
            $color_scheme_1 = $bpxl_cat_color_1;
        } else {
            $color_scheme_1 = $bpxl_goblog_options['bpxl_color_one'];
        }
    } elseif ($bpxl_goblog_options['bpxl_color_one'] != '') {
        $color_scheme_1 = $bpxl_goblog_options['bpxl_color_one'];
    }
    // Navigation
    $bpxl_nav_link_color = "";
    $bpxl_nav_link_hover_color = "";
    $bpxl_nav_dropdown_bg_color = "";
    $bpxl_nav_drop_link_color = "";
    $bpxl_nav_drop_link_hover_color = "";
    if ($bpxl_goblog_options['bpxl_nav_link_color']['regular'] != '') {
        $bpxl_nav_link_color = $bpxl_goblog_options['bpxl_nav_link_color']['regular'];
    }
    if ($bpxl_goblog_options['bpxl_nav_link_color']['hover'] != '') {
        $bpxl_nav_link_hover_color = $bpxl_goblog_options['bpxl_nav_link_color']['hover'];
    }
    if ($bpxl_goblog_options['bpxl_nav_drop_bg_color'] != '') {
        $bpxl_nav_dropdown_bg_color = $bpxl_goblog_options['bpxl_nav_drop_bg_color'];
    }
    if ($bpxl_goblog_options['bpxl_nav_drop_link_color']['regular'] != '') {
        $bpxl_nav_drop_link_color = $bpxl_goblog_options['bpxl_nav_drop_link_color']['regular'];
    }
    if ($bpxl_goblog_options['bpxl_nav_drop_link_color']['hover'] != '') {
        $bpxl_nav_drop_link_hover_color = $bpxl_goblog_options['bpxl_nav_drop_link_color']['hover'];
    }
    // Background Color
    if (!empty($bpxl_goblog_options['bpxl_body_bg']['background-color'])) {
        $background_color = $bpxl_goblog_options['bpxl_body_bg']['background-color'];
    } else {
        $background_color = '#f2f2f2';
    }
    // Background Pattern
    $background_img = get_template_directory_uri() . "/images/bg.png";
    $bg_repeat = 'repeat';
    $bg_attachment = 'scroll';
    $bg_position = '0 0';
    $bg_size = 'auto';
    if (is_category()) {
        if ($cat_bg != '') {
            // Category Background Pattern
            $background_img = $cat_bg['src'];
            $bg_repeat = $cat_repeat;
            $bg_attachment = $cat_attachment;
            $bg_position = $cat_position;
        } elseif (!empty($bpxl_goblog_options['bpxl_body_bg']['background-image'])) {
            // Body Custom Background Pattern
            $background_img = $bpxl_goblog_options['bpxl_body_bg']['background-image'];
            $bg_repeat = $bpxl_goblog_options['bpxl_body_bg']['background-repeat'];
            $bg_attachment = $bpxl_goblog_options['bpxl_body_bg']['background-attachment'];
            $bg_size = $bpxl_goblog_options['bpxl_body_bg']['background-size'];
            $bg_position = $bpxl_goblog_options['bpxl_body_bg']['background-position'];
        } elseif ($bpxl_goblog_options['bpxl_bg_pattern'] != 'nopattern') {
            // Body Default Background Pattern
            $background_img = get_template_directory_uri() . "/images/" . $bpxl_goblog_options['bpxl_bg_pattern'] . ".png";
            $bg_repeat = 'repeat';
            $bg_attachment = 'scroll';
            $bg_position = '0 0';
        }
    } elseif (!empty($bpxl_goblog_options['bpxl_body_bg']['background-image'])) {
        // Body Custom Background Pattern
        $background_img = $bpxl_goblog_options['bpxl_body_bg']['background-image'];
        $bg_repeat = $bpxl_goblog_options['bpxl_body_bg']['background-repeat'];
        $bg_attachment = $bpxl_goblog_options['bpxl_body_bg']['background-attachment'];
        $bg_size = $bpxl_goblog_options['bpxl_body_bg']['background-size'];
        $bg_position = $bpxl_goblog_options['bpxl_body_bg']['background-position'];
    } elseif ($bpxl_goblog_options['bpxl_bg_pattern'] != 'nopattern') {
        // Body Default Background Pattern
        $background_img = get_template_directory_uri() . "/images/" . $bpxl_goblog_options['bpxl_bg_pattern'] . ".png";
        $bg_repeat = 'repeat';
        $bg_attachment = 'scroll';
        $bg_position = '0 0';
        $bg_size = 'auto';
    }
    // Layout Options
    $bpxl_custom_css = '';
    $bpxl_single_layout = '';
    if (is_single() || is_page()) {
        $sidebar_positions = rwmb_meta('bpxl_layout', $args = array('type' => 'image_select'), get_the_ID());
        if (!empty($sidebar_positions)) {
            $sidebar_position = $sidebar_positions;
            if ($sidebar_position == 'left') {
                $bpxl_single_layout = '.single .content-area, .page .content-area { float:right; margin-left:2.4%; margin-right:0 }';
            } elseif ($sidebar_position == 'right') {
                $bpxl_single_layout = '.single .content-area, .page .content-area { float:left; margin-right:2.4%; margin-left:0 }';
            } elseif ($sidebar_position == 'none') {
                $bpxl_single_layout = '.single .content-area, .page .content-area { margin:0; width:100% } .relatedPosts ul li { width:21.6% }';
            }
        }
    }
    // Post Meta
    $bpxl_meta_css = '';
    $bpxl_meta_date_css = '';
    $bpxl_meta_author_css = '';
    $bpxl_single_meta_css = '';
    $bpxl_single_meta_date_css = '';
    $bpxl_single_meta_author_css = '';
    if ($bpxl_goblog_options['bpxl_post_meta'] != '1') {
        $bpxl_meta_css = '.content-home .title-wrap, .content-archive .title-wrap { border:0; min-height:20px; padding-bottom:10px; }';
    }
    if ($bpxl_goblog_options['bpxl_post_meta_options']['2'] != '1') {
        $bpxl_meta_date_css = '.content-home .title-wrap, .content-archive .title-wrap { border:0; min-height:20px; padding-bottom:15px; }';
    }
    if ($bpxl_goblog_options['bpxl_post_meta_options']['6'] != '1') {
        $bpxl_meta_author_css = '.content-home .title-wrap { padding-right:20px }';
    }
    if ($bpxl_goblog_options['bpxl_single_post_meta'] != '1') {
        $bpxl_single_meta_css = '.single-content .post header { border:0; } .single-content .title-wrap { border:0; min-height:20px; padding-bottom:15px; }';
    }
    if ($bpxl_goblog_options['bpxl_single_post_meta_options']['2'] != '1') {
        $bpxl_single_meta_date_css = '.single-content { border:0; } .content-single .title-wrap { border:0; min-height:20px; padding-bottom:15px; }';
    }
    if ($bpxl_goblog_options['bpxl_single_post_meta_options']['6'] != '1') {
        $bpxl_single_meta_author_css = '.single-content .title-wrap { padding-right:20px }';
    }
    // Hex to RGB
    $bpxl_hex = $color_scheme_1;
    list($bpxl_r, $bpxl_g, $bpxl_b) = sscanf($bpxl_hex, "#%02x%02x%02x");
    // Custom CSS
    if ($bpxl_goblog_options['bpxl_custom_css'] != '') {
        $bpxl_custom_css = $bpxl_goblog_options['bpxl_custom_css'];
    }
    $custom_css = "\n\tbody, .menu-pusher { background-color:{$background_color}; background-image:url({$background_img}); background-repeat:{$bg_repeat}; background-attachment:{$bg_attachment}; background-position:{$bg_position} }\n\t.widgetslider .post-cats span, .tagcloud a:hover, .main-navigation ul li ul li a:hover, .menu ul .current-menu-item > a, .pagination span.current, .pagination a:hover, .read-more a, .featuredslider .flex-control-nav .flex-active, #subscribe-widget input[type='submit'], #wp-calendar caption, #wp-calendar td#today, #commentform #submit, .wpcf7-submit, .off-canvas-search .search-button { background-color:{$color_scheme_1}; }\n\ta, a:hover, .title a:hover, .sidebar a:hover, .sidebar-small-widget a:hover, .breadcrumbs a:hover, .meta a:hover, .post-meta a:hover, .reply:hover i, .reply:hover a, .edit-post a, .error-text, #comments .fn a:hover { color:{$color_scheme_1}; }\n\t.main-navigation a:hover, .current-menu-item a, .sfHover a, .tagcloud a:hover, .main-navigation .menu ul li:first-child, .current-menu-parent a { border-color:{$color_scheme_1}; }\n\t.main-navigation .menu > li > ul:before { border-bottom-color:{$color_scheme_1}; }\n\t.main-navigation a { color:{$bpxl_nav_link_color};} .main-navigation a:hover, .current-menu-item a, .current-menu-parent a, #navigation .menu > .sfHover > a.sf-with-ul { color:{$bpxl_nav_link_hover_color};}\n\t.sf-arrows .sf-with-ul:after { border-top-color:{$bpxl_nav_link_color};} .sf-arrows .sf-with-ul:hover:after { border-top-color:{$bpxl_nav_link_hover_color};} .main-navigation ul li ul li a { background:{$bpxl_nav_dropdown_bg_color}; color:{$bpxl_nav_drop_link_color};}\n\t.main-navigation ul li ul li a:hover { color:{$bpxl_nav_drop_link_hover_color};} .sf-arrows ul .sf-with-ul:after { border-left-color:{$bpxl_nav_drop_link_color};}\n\t#wp-calendar th { background: rgba({$bpxl_r},{$bpxl_g},{$bpxl_b}, 0.6) } .header-slider img { opacity:{$bpxl_goblog_options['bpxl_header_slider_opacity']};} {$bpxl_single_layout} {$bpxl_custom_css} {$bpxl_meta_date_css} {$bpxl_single_meta_date_css} {$bpxl_meta_author_css} {$bpxl_single_meta_author_css} {$bpxl_meta_css} {$bpxl_single_meta_css}\n\t";
    wp_add_inline_style('goblog-style', $custom_css);
    // Font-Awesome CSS
    wp_register_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.css');
    wp_enqueue_style('font-awesome');
    // Magnific Popup CSS
    if ($bpxl_goblog_options['bpxl_lightbox'] == '1') {
        wp_register_style('magnific-popup', get_template_directory_uri() . '/css/magnific-popup.css');
        wp_enqueue_style('magnific-popup');
    }
    if ($bpxl_goblog_options['bpxl_responsive_layout'] == '1') {
        // Responsive
        wp_register_style('responsive', get_template_directory_uri() . '/css/responsive.css');
        wp_enqueue_style('responsive');
    }
    if ($bpxl_goblog_options['bpxl_rtl'] == '1') {
        // Responsive
        wp_register_style('rtl', get_template_directory_uri() . '/css/rtl.css');
        wp_enqueue_style('rtl');
    }
}
コード例 #23
0
ファイル: content.php プロジェクト: surreal8/wptheme
 static function get_the_taxonomy_field($taxonomy, $term_id, $field, $parameters = array())
 {
     $value = '';
     // ACF
     if (function_exists('get_field')) {
         $value = get_field($field, $taxonomy . '_' . $term_id);
         if (!isset($parameters['in'])) {
             $parameters['in'] = 'object';
         }
         if (is_array($value)) {
             // Assume image..?
             $parameters['image'] = $field;
         }
         // Which plugin defines get_tax_meta..?
     } elseif (function_exists('get_tax_meta')) {
         $value = get_tax_meta($term_id, $field);
         if (!isset($parameters['in'])) {
             $parameters['in'] = 'id';
         }
     }
     /* elseif (function_exists('get_terms_meta')) {
     
           // https://wordpress.org/plugins/custom-taxonomy-category-and-term-fields/installation/
     
           $value = get_terms_meta($term_id, $field );
           if (is_array($value) && isset($value[0])) {
             // Assume image
             $parameters['image'] = $field;
             $parameters['in']='url';
             $value = $value[0];
           }
         } */
     // Image field
     if (!empty($parameters['image'])) {
         if (empty($parameters['size'])) {
             $parameters['size'] = 'full';
         }
         switch ($parameters['in']) {
             case 'id':
                 $parameters['id'] = $value;
                 $value = wp_get_attachment_image($value, $parameters['size']);
                 break;
             case 'url':
                 $value = '<img src="' . $value . '">';
                 break;
             case 'object':
                 /* image object */
             /* image object */
             default:
                 if (is_array($value)) {
                     $parameters['id'] = $value['id'];
                     $value = wp_get_attachment_image($value['id'], $parameters['size']);
                 } else {
                     $value = wp_get_attachment_image($value, $parameters['size']);
                     // Assume it's ID
                 }
         }
         if (!empty($parameters['out']) && !empty($parameters['id'])) {
             $parameters['field'] = $parameters['out'];
             $value = self::get_the_attachment_field($parameters);
         }
     }
     return $value;
 }
コード例 #24
0
/**
 * Adds listing description to the page.
 *
 * @since 1.0.0
 * @package GeoDirectory_Location_Manager
 *
 * @global object $wpdb WordPress Database object.
 * @global object $wp_query WordPress Query object.
 */
function geodir_location_action_listings_description()
{
    global $wpdb, $wp_query;
    $current_term = $wp_query->get_queried_object();
    $gd_post_type = geodir_get_current_posttype();
    if (isset($current_term->term_id) && $current_term->term_id != '') {
        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
        if ($term_desc && !$saved_data) {
            $saved_data = $term_desc;
        }
        $default_location = geodir_get_default_location();
        $location_type = geodir_what_is_current_location();
        $replace_location = __('Everywhere', GEODIRLOCATION_TEXTDOMAIN);
        $gd_country = get_query_var('gd_country');
        $gd_region = get_query_var('gd_region');
        $gd_city = get_query_var('gd_city');
        $current_location = '';
        if ($gd_country != '') {
            $location_type = 'country';
            $current_location = get_actual_location_name('country', $gd_country, true);
        }
        if ($gd_region != '') {
            $location_type = 'region';
            $current_location = get_actual_location_name('region', $gd_region);
        }
        if ($gd_city != '') {
            $location_type = 'city';
            $current_location = get_actual_location_name('city', $gd_city);
        }
        if ($location_type == 'city') {
            $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
            $option_name = 'geodir_cat_loc_' . $gd_post_type . '_' . $current_term->term_id;
            $cat_loc_option = get_option($option_name);
            $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
            if (!$gd_cat_loc_default && $gd_city != '') {
                $post_type = $gd_post_type;
                $term_id = $current_term->term_id;
                $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
                $location_id = $wpdb->get_var($sql);
                if ($location_id > 0) {
                    $option_name = 'geodir_cat_loc_' . $post_type . '_' . $term_id . '_' . $location_id;
                    $option = get_option($option_name);
                    $gd_cat_loc_desc = !empty($option) && isset($option['gd_cat_loc_desc']) ? trim($option['gd_cat_loc_desc']) : '';
                    if ($gd_cat_loc_desc != '') {
                        $saved_data = stripslashes_deep($gd_cat_loc_desc);
                    }
                }
            }
        } else {
            if ($location_type == 'region') {
                $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
            } else {
                if ($location_type == 'country') {
                    $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
                    $replace_location = __($replace_location, GEODIRECTORY_TEXTDOMAIN);
                }
            }
        }
        $replace_location = $current_location != '' ? $current_location : $replace_location;
        $saved_data = str_replace('%location%', $replace_location, $saved_data);
        $cat_description = apply_filters('the_content', $saved_data);
        if ($cat_description) {
            echo '<div class="term_description">' . $cat_description . '</div>';
        }
    }
}
コード例 #25
0
 function manage_cat_columns($out, $column_name, $texanomy_id)
 {
     foreach (MthemeCore::$components['texa_meta'] as $meta_box) {
         $texanomy = get_term($texanomy_id, $meta_box['cat_type']);
         if ($texanomy != null) {
             switch ($column_name) {
                 case 'shortcode':
                     $out = "[" . $meta_box['shortcode_name'] . " category='" . $texanomy->slug . "'";
                     foreach ($meta_box['shortcode'] as $shortcode) {
                         $out .= " " . $shortcode['title'] . "='" . get_tax_meta($texanomy_id, $shortcode['field'], $shortcode['default']) . "'";
                     }
                     $out .= "]";
                     break;
                 default:
                     break;
             }
         }
     }
     return $out;
 }
コード例 #26
0
			<div id="single_tour_feat">
				<ul>
					<?php 
        require_once get_template_directory() . '/inc/lib/tax-meta-class/Tax-meta-class.php';
        $tour_types = get_the_terms($post_id, 'tour_type');
        $tour_facilities = get_the_terms($post_id, 'tour_facility');
        if (!$tour_types || is_wp_error($tour_types)) {
            $tour_types = array();
        }
        if (!$tour_facilities || is_wp_error($tour_facilities)) {
            $tour_facilities = array();
        }
        $tour_terms = array_merge($tour_types, $tour_facilities);
        foreach ($tour_terms as $tour_term) {
            $term_id = $tour_term->term_id;
            $icon_class = get_tax_meta($term_id, 'ct_tax_icon_class', true);
            echo '<li>';
            if (!empty($icon_class)) {
                echo '<i class="' . esc_attr($icon_class) . '"></i>';
            }
            echo esc_html($tour_term->name);
            echo '</li>';
        }
        ?>
				</ul>
			</div>

			<?php 
        if (!empty($slider)) {
            ?>
				<?php 
コード例 #27
0
ファイル: attribute.php プロジェクト: DaddyFool/travelTest
                <ul class="booking-item-features booking-item-features-expand mb30 clearfix">
                    <?php 
            foreach ($terms as $key2 => $value2) {
                ?>
                        <li class="<?php 
                if ($item_col) {
                    echo 'col-sm-' . $item_col;
                }
                ?>
">
                            <?php 
                if (function_exists('get_tax_meta')) {
                    ?>
                                <i class="<?php 
                    echo TravelHelper::handle_icon(get_tax_meta($value2->term_id, 'st_icon'));
                    ?>
"></i>
                            <?php 
                }
                ?>
                            <span class="booking-item-feature-title"><?php 
                echo esc_html($value2->name);
                ?>
</span>
                        </li>
                    <?php 
            }
            ?>

                </ul>
コード例 #28
0
/**
 * Gets term icon using term ID.
 *
 * If term ID not passed returns all icons.
 *
 * @since 1.0.0
 * @package GeoDirectory
 * @global object $wpdb WordPress Database object.
 * @param int|bool $term_id The term ID.
 * @param bool $rebuild Force rebuild the icons when set to true.
 * @return mixed|string|void Term icon(s).
 */
function geodir_get_term_icon($term_id = false, $rebuild = false)
{
    global $wpdb;
    if (!$rebuild) {
        $terms_icons = get_option('gd_term_icons');
    } else {
        $terms_icons = '';
    }
    if (empty($terms_icons)) {
        $default_icon_url = get_option('geodir_default_marker_icon');
        $taxonomy = geodir_get_taxonomies();
        $post_types = geodir_get_posttypes();
        $tax_arr = array();
        foreach ($post_types as $post_type) {
            $tax_arr[] = "'" . $post_type . "category'";
        }
        $tax_c = implode(',', $tax_arr);
        $terms = $wpdb->get_results("SELECT * FROM {$wpdb->term_taxonomy} WHERE taxonomy IN ({$tax_c})");
        //$terms = get_terms( $taxonomy );
        if ($terms) {
            foreach ($terms as $term) {
                $post_type = str_replace("category", "", $term->taxonomy);
                $a_terms[$post_type][] = $term;
            }
        }
        if ($a_terms) {
            foreach ($a_terms as $pt => $t2) {
                foreach ($t2 as $term) {
                    $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt);
                    if ($term_icon) {
                        $term_icon_url = $term_icon["src"];
                    } else {
                        $term_icon_url = $default_icon_url;
                    }
                    $terms_icons[$term->term_id] = $term_icon_url;
                }
            }
        }
        update_option('gd_term_icons', $terms_icons);
    }
    if ($term_id && isset($terms_icons[$term_id])) {
        return $terms_icons[$term_id];
    } elseif ($term_id && !isset($terms_icons[$term_id])) {
        return get_option('geodir_default_marker_icon');
    }
    if (is_ssl()) {
        $terms_icons = str_replace("http:", "https:", $terms_icons);
    }
    return $terms_icons;
}
コード例 #29
0
ファイル: cat_meta.php プロジェクト: bangjojo/wp
function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
{
    if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) {
        return $cat_default_img;
    } else {
        return false;
    }
}
コード例 #30
0
        function widget($args, $instance)
        {
            $cache = wp_cache_get('widget_recent_posts', 'widget');
            if (!is_array($cache)) {
                $cache = array();
            }
            if (!isset($args['widget_id'])) {
                $args['widget_id'] = $this->id;
            }
            if (isset($cache[$args['widget_id']])) {
                echo $cache[$args['widget_id']];
                return;
            }
            ob_start();
            extract($args);
            $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'cubell') : $instance['title'], $instance, $this->id_base);
            $category = apply_filters('widget_category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base);
            $type = apply_filters('widget_type', empty($instance['type']) ? 'cb-small' : $instance['type'], $instance, $this->id_base);
            if (empty($instance['number']) || !($number = absint($instance['number']))) {
                $number = 5;
            }
            if ($category != 'cb-all') {
                $cb_cat_qry = $category;
            } else {
                $cb_cat_qry = NULL;
            }
            $r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'category_name' => $cb_cat_qry, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
            if ($r->have_posts()) {
                echo $before_widget;
                if ($title) {
                    echo $before_title . $title . $after_title;
                }
                ?>
    		
    		<ul class="cb-light <?php 
                echo $type;
                ?>
">
    		<?php 
                while ($r->have_posts()) {
                    $r->the_post();
                    global $post;
                    $cb_custom_fields = get_post_custom();
                    $cb_global_color = ot_get_option('cb_base_color', '#eb9812');
                    $cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on');
                    $cb_review_checkbox = get_post_meta(get_the_id(), "cb_review_checkbox");
                    if ($type == 'cb-small') {
                        $width = '80';
                        $height = '60';
                        $cb_small_box = true;
                        $cb_class = NULL;
                    }
                    if ($type == 'cb-big') {
                        $width = '360';
                        $height = '240';
                        $cb_small_box = false;
                        $cb_class = ' class="h2"';
                    }
                    $cb_all_categories = get_the_category();
                    $cb_current_cat_id = $cb_all_categories[0]->term_id;
                    $cb_category_color = get_tax_meta($cb_current_cat_id, 'cb_color_field_id');
                    if ($cb_category_color == "#" || $cb_category_color == NULL) {
                        $cb_parent_cat_id = $cb_all_categories[0]->parent;
                        if ($cb_parent_cat_id != '0') {
                            $cb_category_color = get_tax_meta($cb_parent_cat_id, 'cb_color_field_id');
                        }
                        if ($cb_category_color == "#" || $cb_category_color == NULL) {
                            $cb_category_color = $cb_global_color;
                        }
                    }
                    $cb_post_id = $post->ID;
                    $cb_post_format_icon = cb_post_format_check($cb_post_id);
                    ?>
                
                <li class="cb-article clearfix">
                	<div class="cb-mask" style="background-color:<?php 
                    echo $cb_category_color;
                    ?>
;">
                	    <?php 
                    cb_thumbnail($width, $height);
                    echo cb_review_ext_box($cb_post_id, $cb_category_color, $cb_small_box);
                    echo $cb_post_format_icon;
                    ?>
                	</div>
                    <div class="cb-meta">    
                        <h4<?php 
                    echo $cb_class;
                    ?>
><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
                        <?php 
                    echo cb_byline(false, $cb_post_id, true);
                    ?>
                        <?php 
                    if ($type == 'cb-big') {
                        echo '<div class="cb-excerpt">' . cb_clean_excerpt(120) . '</div>';
                    }
                    ?>
                   </div> 
                </li>
    		<?php 
                }
                ?>
    		</ul>
    		<?php 
                echo $after_widget;
                ?>
    <?php 
                // Reset the global $the_post as this query will have stomped on it
                wp_reset_postdata();
            }
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('widget_recent_posts', $cache, 'widget');
        }