• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_the_taxonomies函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_the_taxonomies函数的典型用法代码示例。如果您正苦于以下问题:PHP get_the_taxonomies函数的具体用法?PHP get_the_taxonomies怎么用?PHP get_the_taxonomies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_the_taxonomies函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: test_get_the_taxonomies_term_template

 /**
  * @group 27238
  */
 public function test_get_the_taxonomies_term_template()
 {
     $post_id = $this->factory->post->create();
     $taxes = get_the_taxonomies($post_id, array('term_template' => '%2$s'));
     $this->assertEquals('Categories: Uncategorized.', $taxes['category']);
     $taxes = get_the_taxonomies($post_id, array('term_template' => '<span class="foo"><a href="%1$s">%2$s</a></span>'));
     $link = get_category_link(1);
     $this->assertEquals('Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $taxes['category']);
 }
开发者ID:Benrajalu,项目名称:philRaj,代码行数:12,代码来源:taxonomy.php


示例2: cftl_tax_landing_messages

function cftl_tax_landing_messages($messages)
{
    global $post;
    $taxonomy_array = get_the_taxonomies($post);
    if (!empty($taxonomy_array)) {
        $taxonomy_links = implode(' ', $taxonomy_array);
    } else {
        $taxonomy_links = __("No taxonomies specified.", 'cf-tax-landing');
    }
    $messages['cftl-tax-landing'] = array(0 => '', 1 => sprintf(__('Landing Page updated.  %s', 'cf-tax-landing'), $taxonomy_links), 2 => __('Custom field updated.'), 3 => __('Custom field deleted.'), 4 => __('Landing Page updated.', 'cf-tax-landing'), 5 => isset($_GET['revision']) ? sprintf(__('Landing Page restored to revision from %s', 'cf-tax-landing'), wp_post_revision_title((int) $_GET['revision'], false)) : false, 6 => sprintf(__('Landing Page published.  %s', 'cf-tax-landing'), $taxonomy_links), 7 => __('Landing Page saved.', 'cf-tax-landing'), 8 => sprintf(__('Landing Page submitted.  %s', 'cf-tax-landing'), $taxonomy_links), 9 => sprintf(__('Landing Page scheduled for: <strong>%1$s</strong>.', 'cf-tax-landing'), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date))), 10 => sprintf(__('Landing Page updated.', 'cf-tax-landing')));
    return $messages;
}
开发者ID:netconstructor,项目名称:wp-taxonomy-landing,代码行数:12,代码来源:cftl-post-type.php


示例3: test_get_the_taxonomies

 function test_get_the_taxonomies()
 {
     $post_id = $this->factory->post->create();
     $taxes = get_the_taxonomies($post_id);
     $this->assertNotEmpty($taxes);
     $this->assertEquals(array('category'), array_keys($taxes));
     $id = $this->factory->tag->create();
     wp_set_post_tags($post_id, array($id));
     $taxes = get_the_taxonomies($post_id);
     $this->assertNotEmpty($taxes);
     $this->assertCount(2, $taxes);
     $this->assertEquals(array('category', 'post_tag'), array_keys($taxes));
 }
开发者ID:boonebgorges,项目名称:wp,代码行数:13,代码来源:taxonomy.php


示例4: get_single

 /**
  * Get a single already created AM_Tax.
  *
  * @since 1.2.0
  *
  * @param  null|string $tax_slug Slug of the AM_Tax to get. If null, the first current taxonomy is used.
  * @return null|AM_Tax           The requested AM_Tax, if it exists.
  */
 public static function get_single($tax_slug = null)
 {
     $tax_slug = isset($tax_slug) ? (array) $tax_slug : array_keys(get_the_taxonomies());
     // Get the first entry.
     $tax_slug = reset($tax_slug);
     return array_key_exists($tax_slug, self::$_all_taxs) ? self::$_all_taxs[$tax_slug] : null;
 }
开发者ID:noplanman,项目名称:am-cpts,代码行数:15,代码来源:class-am-cpt-tax.php


示例5: templatic_manage_seller_columns

function templatic_manage_seller_columns($column, $post_id)
{
    echo '<link href="' . get_template_directory_uri() . '/monetize/admin.css" rel="stylesheet" type="text/css" />';
    global $post;
    switch ($column) {
        /* If displaying the 'status' column. */
        case 'status':
            /* Get the post meta. */
            $status = fetch_status(get_post_meta($post_id, 'status', true), get_post_meta($post_id, 'is_expired', true));
            /* If no status is found, output a default message. */
            _e($status, 'templatic');
            break;
            /* If displaying the 'coupon_start_date_time' column. */
        /* If displaying the 'coupon_start_date_time' column. */
        case 'coupon_start_date_time':
            /* Get the coupon_start_date_time for the post. */
            $coupon_start_date_time = get_post_meta($post_id, 'coupon_start_date_time', true);
            /* If coupon_start_date_time were found. */
            if ($coupon_start_date_time != '') {
                echo date('Y-m-d H:i:s', $coupon_start_date_time);
            } else {
                _e('Unknown');
            }
            break;
        case 'coupon_end_date_time':
            /* Get the coupon_end_date_time for the post. */
            $coupon_end_date_time = get_post_meta($post_id, 'coupon_end_date_time', true);
            /* If coupon_end_date_time were found. */
            if (!empty($coupon_end_date_time)) {
                echo date('Y-m-d H:i:s', $coupon_end_date_time);
            } else {
                _e('Continue deal');
            }
            break;
        case 'deal_sold':
            /* Get the deal_sold for the post. */
            $deal_sold = deal_transaction($post_id);
            /* If deal_sold were found. */
            if (!empty($deal_sold)) {
                echo $deal_sold;
            } else {
                _e('0');
            }
            break;
        case 'post_category':
            /* Get the post_category for the post. */
            if (templ_is_show_post_category()) {
                $category = get_the_taxonomies($post);
                $category_display = str_replace(CUSTOM_MENU_CAT_TITLE . ':', '', $category['seller_category']);
                $category_display = str_replace(' and ', ', ', $category_display);
                echo $category_display = str_replace(',,', ', ', $category_display);
            } else {
                _e('Uncategorized');
            }
            break;
        case 'post_tags':
            /* Get the post_tags for the post. */
            $tags = get_the_taxonomies($post);
            $tags_display = str_replace(CUSTOM_MENU_TAG_TITLE . ':', '', $tags['seller_tags']);
            $tags_display = str_replace(' and ', ', ', $tags_display);
            echo $tags_display = str_replace(',,', ', ', $tags_display);
            break;
        case 'total_item':
            /* Get the total_item for the post. */
            $total_item = get_post_meta($post_id, 'no_of_coupon', true);
            /* If terms were found. */
            if (!empty($total_item)) {
                echo $total_item;
            } else {
                _e('0');
            }
            break;
            /* Just break out of the switch statement for everything else. */
        /* Just break out of the switch statement for everything else. */
        default:
            break;
    }
}
开发者ID:annguyenit,项目名称:getdeal,代码行数:78,代码来源:custom_post_type.php


示例6: widget


//.........这里部分代码省略.........
		        					<?php 
                    }
                    ?>
		        					</div>
		        					<?php 
                    if ($instance["mmeta"] == 'aimage') {
                        echo $this->blog_multimeta($instance);
                    }
                    ?>
		        				</div>
		        		   <?php 
                }
                ?>
			        		  <?php 
                if ($video && $instance["mvideo"] == 'atitle') {
                    ?>
		        						<?php 
                    echo do_shortcode($sc);
                    ?>
		        				 <?php 
                }
                ?>
			        		  <?php 
                if ($instance["mmeta"] == 'atitle') {
                    echo $this->blog_multimeta($instance);
                }
                ?>
			        		  <?php 
                if ($instance["excerpt"] == 'true') {
                    ?>
				        		 <p class="post-excerpt"><?php 
                    echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]);
                    ?>
...</p>
			        		  <?php 
                } elseif ($instance['excerpt'] == 'content') {
                    ?>
			        		  	<p class="post-excerpt"><?php 
                    the_content();
                    ?>
</p>
			        		  <?php 
                }
                ?>
			        		  <?php 
                if ($instance["mmeta"] == 'atext') {
                    echo $this->blog_multimeta($instance);
                }
                $tax = '';
                if ($instance["mcats"] == 'acontent') {
                    $tax = array();
                    $_tax = array();
                    $_tax = get_the_taxonomies();
                    if (empty($_tax)) {
                    } else {
                        foreach ($_tax as $key => $value) {
                            preg_match('/(.+?): /i', $value, $matches);
                            $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>';
                        }
                    }
                    echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>';
                }
                if ($instance["mreadmore"] != 'false') {
                    ?>
			        		  		<p style="text-align:<?php 
                    echo $instance["mreadmore"];
                    ?>
">
			        		  		<a href="<?php 
                    the_permalink();
                    ?>
" class="readmorecontent" >
			        		  			<?php 
                    _e($instance["rmtext"], THEME_LANG_DOMAIN);
                    ?>
			        		  		</a>
			        		  		</p>
			        		  <?php 
                }
                ?>
			        		  </div>
			        		  </div>
			        		</div>
		        		 
		        		  
		        		  <?php 
                if ($i == 1) {
                    echo '<div style="clear:both"></div>';
                }
            }
        }
        ?>
        <?php 
        echo '<div style="clear:both"></div>';
        ?>

        <?php 
        wp_reset_postdata();
        $wp_filter['the_content'] = $the_content_filter_backup;
    }
开发者ID:shieldsdesignstudio,项目名称:forefield,代码行数:101,代码来源:custom-content.php


示例7: shortcode_podcast_show

 public function shortcode_podcast_show($attr)
 {
     $err = -1;
     $show = "";
     $all_shows = get_terms('podcast_show', 'hide_empty=0');
     $speaker_tax = 'podcast_speaker';
     $series_tax = 'podcast_series';
     // Error #2: No showname in shortcode given!
     if (empty($attr)) {
         $err = 2;
     }
     // if attributes are given check if these are
     // podcast_show slugs and list only these shows
     if (!empty($attr) and isset($attr['show'])) {
         $possible_shows = $this->get_all_shows($all_shows);
         // Asume: Error #3: No show exists with that name!
         $err = 3;
         foreach ($attr as $key => $value) {
             if (in_array($value, $possible_shows)) {
                 $show = $value;
                 $err = -1;
             }
         }
     }
     $args = array('post_type' => self::POST_TYPE, 'order' => 'DESC', 'oderby' => 'date', 'tax_query' => array('relation' => 'AND', array('taxonomy' => 'podcast_show', 'field' => 'slug', 'terms' => $show)));
     $category_posts = new WP_Query($args);
     $episodes = array();
     while ($category_posts->have_posts()) {
         $category_posts->the_post();
         $i = array_push($episodes, $category_posts->post);
         $postID = $episodes[$i - 1]->ID;
         // $post_tax = array();
         // $post_tax['podcast_show'] = wp_get_post_terms( $postID, 'podcast_show' );
         // $post_tax['podcast_speaker'] = wp_get_post_terms( $postID, $speaker_tax );
         // $post_tax['podcast_series'] = wp_get_post_terms( $postID, $series_tax );
         // $episodes[$i-1]->taxonomies = $post_tax;
         $episodes[$i - 1]->taxonomies = get_the_taxonomies($postID);
         $episodes[$i - 1]->metadata = get_metadata('post', $postID);
     }
     include dirname(dirname(__FILE__)) . 'shortcodes/templates/shortcode_podcast_show-template.php';
 }
开发者ID:ICFMovement,项目名称:dicentis,代码行数:41,代码来源:class-dipo-podcast-post-type.php


示例8: the_taxonomies

function the_taxonomies($args = array()) {
	$defaults = array(
		'post' => 0,
		'before' => '',
		'sep' => ' ',
		'after' => '',
	);

	$r = wp_parse_args( $args, $defaults );
	extract( $r, EXTR_SKIP );

	echo $before . join($sep, get_the_taxonomies($post)) . $after;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:13,代码来源:taxonomy.php


示例9: yoast_breadcrumb

function yoast_breadcrumb($prefix = '', $suffix = '', $display = true)
{
    global $wp_query, $post, $curauth;
    $opt = get_option("yoast_breadcrumbs");
    function bold_or_not($input)
    {
        $opt = get_option("yoast_breadcrumbs");
        if ($opt['boldlast']) {
            return '' . $input . '';
        } else {
            return $input;
        }
    }
    // Copied and adapted from WP source
    function yoast_get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE)
    {
        $chain = '';
        $parent =& get_category($id);
        if (is_wp_error($parent)) {
            return $parent;
        }
        if ($nicename) {
            $name = $parent->slug;
        } else {
            $name = $parent->cat_name;
        }
        if ($parent->parent && $parent->parent != $parent->term_id) {
            $chain .= get_category_parents($parent->parent, true, $separator, $nicename);
        }
        $chain .= bold_or_not($name);
        return $chain;
    }
    function yoast_get_term_parents($id, $term_type = 'category', $link = FALSE, $separator = '/', $nicename = FALSE)
    {
        $chain = '';
        $category = get_term($id, $term_type, $output, $filter);
        if (is_wp_error($category)) {
            return $category;
        }
        _make_cat_compat($category);
        $parent = $category;
        if (is_wp_error($parent)) {
            return $parent;
        }
        if ($nicename) {
            $name = $parent->slug;
        } else {
            $name = $parent->cat_name;
        }
        $term_child = get_term_children($id, $term_type);
        if ($parent->parent && $parent->parent != $parent->term_id) {
            $chain .= '<a href="' . get_term_link($parent->parent, $term_type) . '">' . yoast_get_term_parents($parent->parent, $term_type, true, $separator, $nicename) . '</a>' . $separator;
        }
        $chain .= bold_or_not($name);
        return $chain;
    }
    $nofollow = ' ';
    if ($opt['nofollowhome']) {
        $nofollow = ' rel="nofollow" ';
    }
    $on_front = get_option('show_on_front');
    if ($on_front == "page") {
        $homelink = '<a' . $nofollow . 'href="' . get_permalink(get_option('page_on_front')) . '">' . $opt['home'] . '</a>';
        $bloglink = $homelink . ' ' . $opt['sep'] . ' <a href="' . get_permalink(get_option('page_for_posts')) . '">' . $opt['blog'] . '</a>';
    } else {
        $homelink = '<a' . $nofollow . 'href="' . get_bloginfo('url') . '">' . $opt['home'] . '</a>';
        $bloglink = $homelink;
    }
    if ($on_front == "page" && is_front_page() || $on_front == "posts" && is_home()) {
        $output = bold_or_not($opt['home']);
    } elseif ($on_front == "page" && is_home()) {
        $output = $homelink . ' ' . $opt['sep'] . ' ' . bold_or_not($opt['blog']);
    } elseif (!is_page()) {
        $output = $bloglink . ' ' . $opt['sep'] . ' ';
        if ((is_single() || is_category() || is_tag() || is_date() || is_author()) && $opt['singleparent'] != 0) {
            $output .= '<a href="' . get_permalink($opt['singleparent']) . '">' . get_the_title($opt['singleparent']) . '</a> ' . $opt['sep'] . ' ';
        }
        if (is_single() && $opt['singlecatprefix']) {
            if ($post->post_type == CUSTOM_POST_TYPE1) {
                global $post;
                $cats = wp_get_post_terms($post->ID, CUSTOM_CATEGORY_TYPE1);
                $cat = $cats[0];
                //$output .= yoast_get_term_parents($cat->term_id,CUSTOM_CATEGORY_TYPE1, true, " ".$opt['sep']." ");
                $output .= join(" " . $opt['sep'] . " ", get_the_taxonomies($post)) . " " . $opt['sep'] . " ";
            } else {
                $cats = get_the_category();
                $cat = $cats[0];
                if ($cat) {
                    $output .= get_category_parents($cat->term_id, true, " " . $opt['sep'] . " ");
                }
            }
        }
        if (is_archive()) {
            if (is_tag()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . single_cat_title('', false));
            } elseif (is_date()) {
                $output .= bold_or_not($opt['archiveprefix'] . " " . single_month_title(' ', false));
            } elseif (is_author()) {
                $user = get_userdatabylogin($wp_query->query_vars['author_name']);
                $output .= bold_or_not($opt['archiveprefix'] . " " . $curauth->nickname);
//.........这里部分代码省略.........
开发者ID:exploit86,项目名称:Devoncha,代码行数:101,代码来源:yoast-breadcrumbs.php


示例10: get_field

        ?>
					<div class="slide-3">
						<?php 
        if (get_field('link_externo') == "") {
            $link = get_field('link2');
        } else {
            $link = get_field('link_externo');
        }
        ?>
						<div class="texto-slider">
						<a href="<?php 
        echo $link;
        ?>
">
						<?php 
        $titulo = get_the_taxonomies($post->ID);
        the_content();
        ?>
						</a>			
						</div>
						<a href="<?php 
        echo $link;
        ?>
">
						<?php 
        the_post_thumbnail('slider-1');
        ?>
		
						</a>			
					</div>
					<?php 
开发者ID:willowmagrini,项目名称:dg,代码行数:31,代码来源:front-page.php


示例11: the_content

            the_content();
            ?>
	</div><!-- [ /.entry-body ] -->

	<div class="entry-footer">
	<?php 
            $args = array('before' => '<nav class="page-link"><dl><dt>Pages :</dt><dd>', 'after' => '</dd></dl></nav>', 'link_before' => '<span class="page-numbers">', 'link_after' => '</span>', 'echo' => 1);
            wp_link_pages($args);
            ?>

	<?php 
            /*-------------------------------------------*/
            /*  Category and tax data
            	/*-------------------------------------------*/
            $args = array('template' => __('<dl><dt>%s</dt><dd>%l</dd></dl>', 'lightning'), 'term_template' => '<a href="%1$s">%2$s</a>');
            $taxonomies = get_the_taxonomies($post->ID, $args);
            $taxnomiesHtml = '';
            if ($taxonomies) {
                foreach ($taxonomies as $key => $value) {
                    if ($key != 'post_tag') {
                        $taxnomiesHtml .= '<div class="entry-meta-dataList">' . $value . '</div>';
                    }
                }
                // foreach
            }
            // if ($taxonomies)
            $taxnomiesHtml = apply_filters('lightning_taxnomiesHtml', $taxnomiesHtml);
            echo $taxnomiesHtml;
            ?>

	<?php 
开发者ID:Dr0na,项目名称:Lightning,代码行数:31,代码来源:single.php


示例12: ultimatum_post_tax

function ultimatum_post_tax() {
	global $post;
	$_tax = get_the_taxonomies();
	if (!empty($_tax) ){
		foreach ( $_tax as $key => $value ) {
			preg_match( '/(.+?): /i', $value, $matches );
			$tax[] = '<span class="entry-tax-'. $key .'">' . str_replace( $matches[0], '<span class="entry-tax-meta">'. $matches[1] .':</span> ', $value ) . '</span>';
		}
	}
	if(count($tax)!=0){
	echo '<div class="post-taxonomy">'.join( '<br />', $tax ).'</div>';
	}
}
开发者ID:polaris610,项目名称:medicalhound,代码行数:13,代码来源:loop-functions.php


示例13: the_title

        the_title('<h1 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h1>');
    }
    ?>

						<div class="entry-meta">
							<?php 
    if (!post_password_required() && (comments_open() || get_comments_number())) {
        ?>
							<span class="comments-link"><?php 
        comments_popup_link(__('Leave a comment', 'dicentis'), __('1 Comment', 'dicentis'), __('% Comments', 'dicentis'));
        ?>
</span>
							<?php 
    }
    edit_post_link(__('Edit', 'dicentis'), '<span class="edit-link">', '</span>');
    $taxonomy_names = get_the_taxonomies();
    foreach ($taxonomy_names as $key => $value) {
        echo $value;
        echo " | ";
    }
    ?>
						</div><!-- .entry-meta -->
					</header><!-- .entry-header -->

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

					<?php 
    } else {
        ?>
开发者ID:ICFMovement,项目名称:dicentis,代码行数:31,代码来源:episode-single-template.php


示例14: esc_html__



	<!--Portfolio holder -->
	<div class="relatedHolder ofsTop ofsBottom">

		<!--Title-->
		<div class="title dark ">
			<h1>
				<?php 
        echo esc_html__('Related Works', 'pranon');
        ?>
<span class="plus">+</span>
			</h1>
		</div>
		<?php 
        $taxonomy = get_the_taxonomies(get_the_ID());
        if (isset($taxonomy)) {
            foreach ($taxonomy as $key => $name) {
                $taxonomy_name = $key;
            }
            $get_terms = get_the_terms(get_the_ID(), $taxonomy_name);
            $term = array();
            $display_term = '';
            foreach ($get_terms as $key => $get_term) {
                array_push($term, $get_term->slug);
                if ($key == count($get_terms) - 1) {
                    $display_term .= esc_html($get_term->name);
                } else {
                    $display_term .= esc_html($get_term->name) . ', ';
                }
            }
开发者ID:pranonTeam,项目名称:pranon_wp_development,代码行数:29,代码来源:single-portfolio.php


示例15: cftl_tax_landing_extras_box

function cftl_tax_landing_extras_box($post)
{
    wp_nonce_field(plugin_basename(__FILE__), 'cftl_tax_landing_extras_nonce');
    $taxonomy_array = get_the_taxonomies($post);
    if (!empty($taxonomy_array)) {
        $taxonomy_links = implode('<br/>', $taxonomy_array);
    } else {
        $taxonomy_links = __("No taxonomies specified.", 'cf-tax-landing');
    }
    $page_template = get_post_meta($post->ID, '_wp_page_template', true);
    ?>
<div class="form-field">
	<label for="cftl_page_template"><?php 
    _e('Page Template', 'cf-tax-landing');
    ?>
</label>
	<select name="cftl_page_template" id="cftl_page_template">
		<option value=""<?php 
    echo empty($page_template) ? ' selected="selected"' : '';
    ?>
><?php 
    _e('No Template (Use Post Templates)', 'cf-tax-landing');
    ?>
</option>
		<option value="default"<?php 
    echo "default" == $page_template ? ' selected="selected"' : '';
    ?>
><?php 
    _e('Default (Page) Template', 'cf-tax-landing');
    ?>
</option>
		<?php 
    page_template_dropdown($page_template);
    ?>
	</select>
</div>
<div class="form-field">
	<label><?php 
    _e('Current taxonomy links:', 'cf-tax-landing');
    ?>
</label><br/>
	<?php 
    echo $taxonomy_links;
    ?>
</div>
<?php 
}
开发者ID:NathanLawrence,项目名称:Largo,代码行数:47,代码来源:cftl-admin.php


示例16: excerpt_in_category

 function excerpt_in_category($opt_category, $width)
 {
     /**
      * excerpt in category
      */
     $return['data'] = $this->content;
     $return['excerpt'] = false;
     $taxonomies = get_the_taxonomies(get_the_ID());
     foreach ($taxonomies as $key => $value) {
         $taxonomy = $key;
         $category = wp_get_post_terms(get_the_ID(), $taxonomy);
         foreach ($category as $n) {
             $current_category = $n->term_id;
             $excerpt_in_category = $opt_category;
             if (is_array($excerpt_in_category) && in_array($current_category, $excerpt_in_category)) {
                 $return['data'] = tonjoo_ecae_excerpt($this->content, $width, $this->justify);
                 $return['excerpt'] = true;
                 break 2;
             }
         }
     }
     return $return;
 }
开发者ID:AndyHuntDesign,项目名称:andyhuntdesign,代码行数:23,代码来源:easy-custom-auto-excerpt.php


示例17: rt_get_post_navigation

 function rt_get_post_navigation()
 {
     global $post;
     if (is_singular("portfolio")) {
         if (!get_option(RT_THEMESLUG . '_hide_portfolio_navigation')) {
             return false;
         }
     }
     if (is_singular("products")) {
         if (!get_option(RT_THEMESLUG . '_hide_product_navigation')) {
             return false;
         }
     }
     if (!is_singular("portfolio") && !is_singular("products") || post_password_required()) {
         return false;
     }
     //next and previous links
     $rt_taxonomy = key(get_the_taxonomies($post->ID));
     $terms = get_the_terms($post->ID, $rt_taxonomy);
     $prev = is_array($terms) ? rt_mod_get_adjacent_post(true, true, '', $rt_taxonomy, 'date') : get_adjacent_post("", "", true);
     $next = is_array($terms) ? rt_mod_get_adjacent_post(true, false, '', $rt_taxonomy, 'date') : get_adjacent_post("", "", false);
     $prev_post_link_url = $prev ? get_permalink($prev->ID) : "";
     $next_post_link_url = $next ? get_permalink($next->ID) : "";
     $next_post_link = $next_post_link_url ? rt_shortcode_button(array("id" => '', "button_size" => 'small', "href_title" => __('Next Post', 'rt_theme') . ": " . $next->post_title, "button_link" => $next_post_link_url, "button_icon" => 'icon-right-open', "button_style" => 'white', "link_open" => '_self', "margin_top" => 0)) : false;
     $prev_post_link = $prev_post_link_url ? rt_shortcode_button(array("id" => '', "button_size" => 'small', "href_title" => __('Previous Post', 'rt_theme') . " :" . $prev->post_title, "button_link" => $prev_post_link_url, "button_icon" => 'icon-left-open', "button_style" => 'white', "link_open" => '_self', "margin_top" => 0)) : false;
     $add_class = $prev_post_link == false || $next_post_link == false ? "single" : "";
     // if previous link is empty add class to fix white border
     $post_navigation = $next_post_link || $prev_post_link ? '<div class="post-navigations margin-b20 ' . $add_class . '">' . $prev_post_link . '' . $next_post_link . '</div>' : "";
     echo $post_navigation;
 }
开发者ID:nikolaev-k,项目名称:alwadi,代码行数:30,代码来源:theme_functions.php


示例18: the_taxonomies

/**
 * Display the taxonomies of a post with available options.
 *
 * This function can be used within the loop to display the taxonomies for a
 * post without specifying the Post ID. You can also use it outside the Loop to
 * display the taxonomies for a specific post.
 *
 * The available defaults are:
 * 'post' : default is 0. The post ID to get taxonomies of.
 * 'before' : default is empty string. Display before taxonomies list.
 * 'sep' : default is empty string. Separate every taxonomy with value in this.
 * 'after' : default is empty string. Display this after the taxonomies list.
 * 'template' : The template to use for displaying the taxonomy terms.
 *
 * @since 2.5.0
 * @uses get_the_taxonomies()
 *
 * @param array $args Override the defaults.
 */
function the_taxonomies( $args = array() ) {
	$defaults = array(
		'post' => 0,
		'before' => '',
		'sep' => ' ',
		'after' => '',
		/* translators: %s: taxonomy label, %l: list of term links */
		'template' => __( '%s: %l.' )
	);

	$r = wp_parse_args( $args, $defaults );

	echo $r['before'] . join( $r['sep'], get_the_taxonomies( $r['post'], $r ) ) . $r['after'];
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:33,代码来源:taxonomy.php


示例19: the_modified_date

the_modified_date('');
?>
</span></span>

<?php 
// Post author
$meta_hidden_author = isset($lightning_theme_options['postAuthor_hidden']) && $lightning_theme_options['postAuthor_hidden'] ? ' entry-meta_hidden' : '';
?>

<span class="vcard author entry-meta_items entry-meta_items_author<?php 
echo $meta_hidden_author;
?>
"><span class="fn"><?php 
the_author();
?>
</span></span>

<?php 
$page_for_posts = lightning_get_page_for_posts();
$taxonomies = get_the_taxonomies();
if ($taxonomies) {
    // get $taxonomy name
    $taxonomy = key($taxonomies);
    $terms = get_the_terms(get_the_ID(), $taxonomy);
    $term_url = esc_url(get_term_link($terms[0]->term_id, $taxonomy));
    $term_name = esc_html($terms[0]->name);
    echo '<span class="entry-meta_items entry-meta_items_term"><a href="' . $term_url . '" class="btn btn-xs btn-primary">' . $term_name . '</a></span>';
}
?>

</div>
开发者ID:Dr0na,项目名称:Lightning,代码行数:31,代码来源:module_loop_post_meta.php


示例20: widget


//.........这里部分代码省略.........
" ><?php 
                                the_title();
                                ?>
</a></h2>
                    <?php 
                            }
                            ?>
                    <?php 
                            if ($instance["meta"] == 'atitle') {
                                echo $this->blog_meta($instance);
                            }
                            ?>
                    <div class="the-post-content">
                    <?php 
                            $retainformat = false;
                            if ($retainformat) {
                                $content = get_the_content_with_formatting();
                                $content = apply_filters('the_content', $content);
                                echo $content;
                            } else {
                                the_content();
                            }
                            ?>
                    <?php 
                            wp_link_pages();
                            ?>
                    </div>

                    <?php 
                            if ($instance["meta"] == 'atext') {
                                echo $this->blog_meta($instance);
                            }
                            if ($instance["cats"] == 'acontent' && !is_page()) {
                                $_tax = get_the_taxonomies();
                                if (empty($_tax)) {
                                } else {
                                    foreach ($_tax as $key => $value) {
                                        preg_match('/(.+?): /i', $value, $matches);
                                        $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>';
                                    }
                                }
                                echo '<div class="post-taxonomy">' . join('<br />', $tax) . '</div>';
                            }
                            ?>
                    </div>

                    </div>
                    <?php 
                            //echo get_post_meta($post->ID, 'ultimatum_author', true);
                            if (get_post_meta($post->ID, 'ultimatum_author', true) == 'true') {
                                if (get_the_author_meta('description') && is_multi_author()) {
                                    // If a user has filled out their description and this is a multi-author blog, show a bio on their entries
                                    ?>
                     <div id="author-info">
                        <div id="author-avatar">
                           <?php 
                                    echo get_avatar(get_the_author_meta('user_email'), 68);
                                    ?>
                        </div><!-- #author-avatar -->
                        <div id="author-description">
                           <h2><?php 
                                    printf(esc_attr__('About %s', THEME_LANG_DOMAIN), get_the_author());
                                    ?>
</h2>
                           <?php 
                                    the_author_meta('description');
开发者ID:shieldsdesignstudio,项目名称:forefield,代码行数:67,代码来源:the-content.php



注:本文中的get_the_taxonomies函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_the_term_list函数代码示例发布时间:2022-05-15
下一篇:
PHP get_the_tags函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap