本文整理汇总了PHP中get_tax_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP get_tax_meta函数的具体用法?PHP get_tax_meta怎么用?PHP get_tax_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_tax_meta函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_category_meta
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;
}
}
开发者ID:chrislafay,项目名称:cccwd,代码行数:32,代码来源:functions.php
示例2: add_price_column_content
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;
}
开发者ID:nashlesigon,项目名称:wc-pwinty,代码行数:7,代码来源:pwinty-wc-custom-post-types-taxonomies.php
示例3: product_cat_column
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;
}
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:8,代码来源:class.attributes.php
示例4: kdesc_title_tag_rewtite
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;
}
开发者ID:b9sk,项目名称:kdesc,代码行数:8,代码来源:kdesc.php
示例5: add_to_context
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;
}
开发者ID:pedrokoblitz,项目名称:centro-dialogo-aberto,代码行数:23,代码来源:functions.php
示例6: dt_geodir_insert_taxonomy
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);
}
}
开发者ID:mistergiri,项目名称:directory-starter,代码行数:24,代码来源:dummy.php
示例7: get_all_category_ids
<?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(){
开发者ID:ImtiH,项目名称:BAPWD,代码行数:31,代码来源:custom-css.php
示例8: array
*
* @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');
开发者ID:pedrokoblitz,项目名称:centro-dialogo-aberto,代码行数:31,代码来源:resultado-passo-1.php
示例9: foreach
$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("′", "⁄", "–", "“", '');
开发者ID:bangjojo,项目名称:wp,代码行数:31,代码来源:listing-preview.php
示例10: get_stylesheet_directory
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')) {
开发者ID:washingtonstateuniversity,项目名称:CAHNRSWP-Theme-WSU,代码行数:31,代码来源:header.php
示例11: get_terms
<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">
开发者ID:eellak,项目名称:opengov_website,代码行数:31,代码来源:template_submit_idea.php
示例12: geodir_add_meta_keywords
//.........这里部分代码省略.........
$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;
开发者ID:kkoppenhaver,项目名称:geodirectory,代码行数:67,代码来源:custom_functions.php
示例13: get_term_by
<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');
?>
开发者ID:accrane,项目名称:Theme-Untamed-Science,代码行数:31,代码来源:sidebar-biodiversity.php
示例14: esc_attr
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
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:attribute.php
示例15: get_terms
<?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
}
}
?>
开发者ID:JeppeSigaard,项目名称:smamo16,代码行数:31,代码来源:case-links.php
示例16:
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++;
}
}
}
}
}
}
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:attribute-grid.php
示例17: foreach
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
}
开发者ID:markbaindesign,项目名称:mbd-wp-theme,代码行数:31,代码来源:module-categories-grid.php
示例18: cb_related_posts_block
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>
//.........这里部分代码省略.........
开发者ID:TechDevMX,项目名称:BlogJivamukti,代码行数:101,代码来源:core.php
示例19: _e
<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
开发者ID:DaddyFool,项目名称:travelTest,代码行数:30,代码来源:user-edit-hotel.php
示例20: get_currentuserinfo
// 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();
开发者ID:JigSawFr,项目名称:iftheme,代码行数:31,代码来源:theme-taxo-classes.php
注:本文中的get_tax_meta函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论