当前位置: 首页>>代码示例>>PHP>>正文


PHP post_permalink函数代码示例

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


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

示例1: widget

    public function widget($args, $instance)
    {
        $number_of_episodes = is_numeric($instance['number_of_episodes']) ? $instance['number_of_episodes'] : 10;
        // Fallback for old browsers that allow a non-numeric string to be entered in the "number_of_episodes" field
        $episodes = array_slice(Episode::find_all_by_time(['post_status' => ['private', 'publish']]), 0, $number_of_episodes);
        echo $args['before_widget'];
        if (!empty($instance['title'])) {
            echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
        }
        echo "<ul style='list-style-type: none;'>";
        foreach ($episodes as $episode) {
            $post = get_post($episode->post_id);
            $episode_duration = new \Podlove\Duration($episode->duration);
            ?>
				<li>
					<?php 
            if ($instance['show_image']) {
                ?>
					<img src="<?php 
                echo $episode->cover_art_with_fallback()->setWidth(400)->url();
                ?>
" alt="<?php 
                echo $post->post_title;
                ?>
" style="width: 20%; vertical-align: top; margin-right: 2%;"/>
					<div style="display: inline-block; width: 75%;">
					<?php 
            }
            ?>
					<p>
						<a href="<?php 
            echo post_permalink($episode->post_id);
            ?>
"><?php 
            echo $post->post_title;
            ?>
</a><br />
						<i class="podlove-icon-calendar"></i> <?php 
            echo get_the_date(get_option('date_format'), $episode->post_id);
            ?>
						<?php 
            if ($instance['show_duration']) {
                echo "<br /><i class='podlove-icon-time'></i> " . $episode_duration->get('human-readable');
            }
            ?>
					</p>
					<?php 
            if ($instance['show_image']) {
                ?>
					</div>
					<?php 
            }
            ?>
				</li>
			<?php 
        }
        echo "</ul>";
        echo $args['after_widget'];
    }
开发者ID:johannes-mueller,项目名称:podlove-publisher,代码行数:59,代码来源:recent_episodes.php

示例2: featured_image_archive

function featured_image_archive()
{
    if (has_post_thumbnail()) {
        echo '<div id = "featured-post-archive-image">';
        echo '<a href = "' . post_permalink($post->{$ID}) . '">';
        the_post_thumbnail($post->ID, 'feature-post-archive');
        echo '</a>';
        echo '</div>';
    }
}
开发者ID:ashenkar,项目名称:sanga,代码行数:10,代码来源:page-posts.php

示例3: mdr_postrss

/**
 * Filter to added content to the bottom of rss feeds
 *
 * @param string $content The content of the page/post in the rrs feed.
 *
 * @author Matt Rude <matt@mattrude.com>
 * @package Gus Theme
 * @subpackage Feed Footer
 * @since 0.2
 */
function mdr_postrss($content)
{
    if (is_feed()) {
        $site_name = get_bloginfo_rss('name');
        $post_title = get_the_title_rss();
        $home_url = home_url('/');
        $post_url = post_permalink();
        $content = $content . '<a href="' . $post_url . '">' . $post_title . '</a> is a post from; <a href="' . $home_url . '">' . $site_name . '</a> which is not allowed to be copied on other sites.';
    }
    return $content;
}
开发者ID:SloppierKitty7,项目名称:wp-theme-gus,代码行数:21,代码来源:feed-footer.php

示例4: update_recipes_request

function update_recipes_request()
{
    if (!empty($_POST["id"])) {
        $post_id = $_POST["id"];
        $post = get_post($post_id);
        $url = post_permalink($post_id);
        $ingredients = get_post_meta($post_id, 'RECIPE_META_ingredients', true);
        $nutrition_facts = process_request($ingredients);
        if (isValid($nutrition_facts)) {
            if (!add_post_meta($post_id, META_KEY, $nutrition_facts, true)) {
                update_post_meta($post_id, META_KEY, $nutrition_facts);
            }
            echo json_encode(array('ID' => $post->ID, 'post_title' => $post->post_title, 'url' => $url, 'success' => true, 'error' => false, 'message' => 'Update successful.'));
        } else {
            echo json_encode(array('ID' => $post->ID, 'post_title' => $post->post_title, 'url' => $url, 'success' => false, 'error' => true, 'message' => 'Update unsuccessful.'));
        }
    }
    die;
}
开发者ID:clintwine,项目名称:nutrition-facts-label,代码行数:19,代码来源:process.php

示例5: kaitain_share_links

/**
 * Output Social Sharing Links
 * -----------------------------------------------------------------------------
 * @category   PHP Script
 * @package    Kaitain
 * @author     Mark Grealish <mark@bhalash.com>
 * @copyright  Copyright (c) 2014-2015, Tuairisc Bheo Teo
 * @license    https://www.gnu.org/copyleft/gpl.html The GNU GPL v3.0
 * @version    2.0
 * @link       https://github.com/bhalash/kaitain-theme
 * @link       http://www.tuairisc.ie
 */
function kaitain_share_links()
{
    global $post;
    if (!($post = get_post($post))) {
        return false;
    }
    $post_info = array('blog' => urlencode(get_bloginfo('name')), 'url' => urlencode(post_permalink($post->ID)), 'title' => urlencode($post->post_title), 'tuser' => 'tuairiscnuacht');
    $services = array('print' => array('title' => 'Print %s', 'href' => 'javascript:window.print()', 'target' => '', 'reqires' => null), 'twitter' => array('title' => 'Tweet %s', 'href' => sprintf('//twitter.com/share?via=%s&text=%s&url=%s&related=@%s', $post_info['tuser'], $post_info['title'], $post_info['url'], $post_info['tuser']), 'target' => '_blank'), 'facebook' => array('title' => 'Share %s', 'href' => sprintf('//facebook.com/sharer.php?u=%s', $post_info['url']), 'target' => '_blank'), 'email' => array('title' => 'Email %s', 'href' => sprintf('mailto:?subject=%s&amp;body=%s', $post_info['title'], $post_info['url']), 'target' => '_blank'), 'discuss' => array('href' => '#comments', 'title' => 'Read comments on %s', 'target' => ''));
    printf('<nav class="%s">', 'article__sharing');
    printf('<ul class="%s">', 'article__sharemenu');
    foreach ($services as $service => $service_info) {
        if ($service === 'discuss' && !is_singular('post') && comments_open($post->ID)) {
            // Skip comment if it isn't a single post and comments are open.
            continue;
        }
        kaitain_social_link($post_info, $service, $service_info);
    }
    printf('</ul>');
    printf('</nav>');
}
开发者ID:tuairisc,项目名称:kaitain,代码行数:32,代码来源:kaitain-social-share.php

示例6: load

    function load()
    {
        global $multipage, $page, $pings;
        if ($page == 1) {
            comments_template('', true);
        } else {
            ?>
			<div id="comments">
				<div class="page">
					<h3><?php 
            _e('Comments', 'guangzhou');
            ?>
</h3>
					<p><?php 
            printf(__('Comments are shown on the <a href="%s">first page</a>.', 'guangzhou'), post_permalink());
            ?>
</p>
				</div>
			</div>
			<?php 
        }
    }
开发者ID:billerby,项目名称:Surdeg,代码行数:22,代码来源:comments.php

示例7: vc_service_function

 function vc_service_function($atts, $content = null)
 {
     $output = '';
     extract(shortcode_atts(array('title' => '', 'head_icon' => '', 'count_word' => '', 'count_items' => '', 'select_categories' => '', 'button_title' => '', 'style' => 2, 'size' => ''), $atts));
     $array_size = ['thumbnail', 'medium', 'large', 'full '];
     if (!in_array(trim($size), $array_size)) {
         $size = 'medium';
     }
     $output .= '<section id="service-section" class="service-section ow-section">';
     $output .= '<div class="container"><div class="section-header">';
     $output .= '<h3><img src="' . wp_get_attachment_url($head_icon) . '" alt="sep-icon" /> ' . $title . '</h3></div> ';
     $output .= '<div id="make-clean-service" class="owl-carousel owl-theme services-style' . $style . '">';
     if (is_numeric($select_categories) && $select_categories >= 0) {
         if (!is_numeric($count_items)) {
             $count_items = 0;
         }
         $list_post = get_posts(['category' => $select_categories, 'posts_per_page' => $count_items]);
         foreach ($list_post as $post) {
             setup_postdata($post);
             $content = get_the_content();
             $output .= '<div class="item">';
             $output .= '<div class="service-box">';
             $output .= get_the_post_thumbnail($post->ID, $size);
             $output .= '<div class="service-box-inner">';
             $output .= '<h4>' . get_the_title($post->ID) . '</h4>';
             if ($style == 2) {
                 $output .= '<p>' . the_excerpt_max_charlength($content, $count_word) . '</p>';
             }
             $output .= '<a title="xx' . $button_title . '" href="' . post_permalink($post->ID) . '">' . $button_title . '</a>';
             $output .= '</div></div></div>';
         }
     }
     $output .= '</div></div> </div> ';
     $output .= '</section>';
     return $output;
 }
开发者ID:khiconit,项目名称:makeclean,代码行数:36,代码来源:visual_composer.php

示例8: mw_getRecentPosts

	function mw_getRecentPosts($args) {

		$this->escape($args);

		$blog_ID     = $args[0];
		$user_login  = $args[1];
		$user_pass   = $args[2];
		$num_posts   = $args[3];

		if (!$this->login_pass_ok($user_login, $user_pass)) {
			return $this->error;
		}

		$posts_list = wp_get_recent_posts($num_posts);

		if (!$posts_list) {
			$this->error = new IXR_Error(500, 'Either there are no posts, or something went wrong.');
			return $this->error;
		}

		foreach ($posts_list as $entry) {

			$post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']);
			$categories = array();
			$catids = wp_get_post_categories($entry['ID']);
			foreach($catids as $catid) {
				$categories[] = get_cat_name($catid);
			}

			$post = get_extended($entry['post_content']);
			$link = post_permalink($entry['ID']);

			$allow_comments = ('open' == $entry['comment_status']) ? 1 : 0;
			$allow_pings = ('open' == $entry['ping_status']) ? 1 : 0;

			$struct[] = array(
				'dateCreated' => new IXR_Date($post_date),
				'userid' => $entry['post_author'],
				'postid' => $entry['ID'],
				'description' => $post['main'],
				'title' => $entry['post_title'],
				'link' => $link,
				'permaLink' => $link,
// commented out because no other tool seems to use this
//	      'content' => $entry['post_content'],
				'categories' => $categories,
				'mt_excerpt' => $entry['post_excerpt'],
				'mt_text_more' => $post['extended'],
				'mt_allow_comments' => $allow_comments,
				'mt_allow_pings' => $allow_pings
			);

		}

		$recent_posts = array();
		for ($j=0; $j<count($struct); $j++) {
			array_push($recent_posts, $struct[$j]);
		}

		return $recent_posts;
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:61,代码来源:xmlrpc.php

示例9: iron_breadcrumbs

function iron_breadcrumbs($id = 'breadcrumbs', $class = 'breadcrumbs')
{
    global $post_type;
    echo '<nav id="' . $id . '" class="' . $class . '"><ul>';
    if (is_paged() || is_singular() || is_author() || is_tax() || is_category() || is_tag() || is_date()) {
        echo '<li><a href="' . home_url('/') . '">' . __('Home', IRON_TEXT_DOMAIN) . '</a></li>';
    }
    if ((is_paged() || is_singular() || is_tax() || is_category() || is_tag() || is_date()) && (!is_page() || !is_attachment())) {
        global $iron_post_types;
        # Post Type
        if (empty($post_type)) {
            $post_type = get_post_type();
        }
        $url = '';
        if (in_array($post_type, $iron_post_types)) {
            $archive_page = get_iron_option('page_for_' . $post_type . 's');
        } else {
            $archive_page = get_option('page_for_' . $post_type . 's');
        }
        if ($archive_page > 0) {
            $url = post_permalink($archive_page);
            if (!empty($url)) {
                echo '<li><a href="' . $url . '">' . get_the_title($archive_page) . '</a></li>';
            }
        }
    }
    if (is_archive()) {
        # Term
        if (is_tax()) {
            $taxonomy = get_query_var('taxonomy');
            $term = get_term_by('slug', get_query_var('term'), $taxonomy);
        } elseif (is_category()) {
            $taxonomy = 'category';
            $term = get_category(get_query_var('cat'));
        } elseif (is_tag()) {
            $taxonomy = 'post_tag';
            $term = get_term_by('slug', get_query_var('tag'), $taxonomy);
        }
        if (!empty($term) && !is_wp_error($term)) {
            echo '<li><a href="' . get_term_link($term->slug, $taxonomy) . '">' . $term->name . '</a></li>';
        }
        # A Date/Time Page
        if (is_day()) {
            echo '<li>' . sprintf(__('Archive for %s', IRON_TEXT_DOMAIN), get_the_date()) . '</li>';
        } elseif (is_month()) {
            echo '<li>' . sprintf(__('Archive for %s', IRON_TEXT_DOMAIN), get_the_date(_x('F Y', 'monthly archives date format', IRON_TEXT_DOMAIN))) . '</li>';
        } elseif (is_year()) {
            echo '<li>' . sprintf(__('Archive for %s', IRON_TEXT_DOMAIN), get_the_date(_x('Y', 'yearly archives date format', IRON_TEXT_DOMAIN))) . '</li>';
        } elseif (is_author()) {
            $author = get_userdata(get_query_var('author'));
            echo '<li>' . sprintf(__('Archive for %s', IRON_TEXT_DOMAIN), $author->display_name) . '</li>';
        }
    } elseif (is_search()) {
        echo '<li>' . __('Results', IRON_TEXT_DOMAIN) . '</li>';
    }
    // Index Pagination
    if (is_paged()) {
        echo '<li>' . sprintf(__('Page %s', IRON_TEXT_DOMAIN), get_query_var('paged')) . '</li>';
    }
    # A Single Page, Single Post or Attachment
    if (is_singular()) {
        echo '<li>' . get_the_title() . '</li>';
        // Post Pagination
        $paged = get_query_var('page');
        if (is_single() && $paged > 1) {
            echo '<li>' . sprintf(__('Page %s', IRON_TEXT_DOMAIN), $paged) . '</li>';
        }
    }
    echo '</ul></nav>';
}
开发者ID:hathbanger,项目名称:squab,代码行数:70,代码来源:functions.php

示例10: mw_getRecentPosts

 function mw_getRecentPosts($args)
 {
     $this->escape($args);
     $blog_ID = (int) $args[0];
     $user_login = $args[1];
     $user_pass = $args[2];
     $num_posts = (int) $args[3];
     if (!$this->login_pass_ok($user_login, $user_pass)) {
         return $this->error;
     }
     $posts_list = wp_get_recent_posts($num_posts);
     if (!$posts_list) {
         $this->error = new IXR_Error(500, __('Either there are no posts, or something went wrong.'));
         return $this->error;
     }
     set_current_user(0, $user_login);
     foreach ($posts_list as $entry) {
         if (!current_user_can('edit_post', $entry['ID'])) {
             continue;
         }
         $post_date = mysql2date('Ymd\\TH:i:s', $entry['post_date']);
         $post_date_gmt = mysql2date('Ymd\\TH:i:s', $entry['post_date_gmt']);
         $categories = array();
         $catids = wp_get_post_categories($entry['ID']);
         foreach ($catids as $catid) {
             $categories[] = get_cat_name($catid);
         }
         $tagnames = array();
         $tags = wp_get_post_tags($entry['ID']);
         if (!empty($tags)) {
             foreach ($tags as $tag) {
                 $tagnames[] = $tag->name;
             }
             $tagnames = implode(', ', $tagnames);
         } else {
             $tagnames = '';
         }
         $post = get_extended($entry['post_content']);
         $link = post_permalink($entry['ID']);
         // Get the post author info.
         $author = get_userdata($entry['post_author']);
         $allow_comments = 'open' == $entry['comment_status'] ? 1 : 0;
         $allow_pings = 'open' == $entry['ping_status'] ? 1 : 0;
         $struct[] = array('dateCreated' => new IXR_Date($post_date), 'userid' => $entry['post_author'], 'postid' => $entry['ID'], 'description' => $post['main'], 'title' => $entry['post_title'], 'link' => $link, 'permaLink' => $link, 'categories' => $categories, 'mt_excerpt' => $entry['post_excerpt'], 'mt_text_more' => $post['extended'], 'mt_allow_comments' => $allow_comments, 'mt_allow_pings' => $allow_pings, 'mt_keywords' => $tagnames, 'wp_slug' => $entry['post_name'], 'wp_password' => $entry['post_password'], 'wp_author_id' => $author->ID, 'wp_author_display_name' => $author->display_name, 'date_created_gmt' => new IXR_Date($post_date_gmt));
     }
     $recent_posts = array();
     for ($j = 0; $j < count($struct); $j++) {
         array_push($recent_posts, $struct[$j]);
     }
     return $recent_posts;
 }
开发者ID:helmonaut,项目名称:owb-mirror,代码行数:51,代码来源:xmlrpc.php

示例11: widget

    function widget($args, $instance)
    {
        global $wpdb, $comments, $comment;
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', empty($instance['title']) ? theme_locals("recent_comments_decs") : $instance['title']);
        $comments_count = apply_filters('widget_title', empty($instance['comments_count']) ? 5 : $instance['comments_count']);
        $display_avatar = apply_filters('widget_display_avatar', empty($instance['display_avatar']) ? 'off' : 'on');
        $avatar_size = apply_filters('widget_avatar_size', empty($instance['avatar_size']) ? '48' : $instance['avatar_size']);
        $display_author_name = apply_filters('widget_display_author_name', empty($instance['display_author_name']) ? 'off' : 'on');
        $display_date = apply_filters('widget_display_date', empty($instance['display_date']) ? 'off' : 'on');
        $display_post_title = apply_filters('widget_display_post_title', empty($instance['display_post_title']) ? 'off' : 'on');
        $meta_format = apply_filters('widget_meta_format', empty($instance['meta_format']) ? 'none' : $instance['meta_format']);
        if ($comments_count < 1) {
            $comments_count = 1;
        } else {
            if ($comments_count > 15) {
                $comments_count = 15;
            }
        }
        $comment_len = 100;
        if (function_exists('wpml_get_language_information')) {
            global $sitepress;
            $sql = "\r\r\n\t\t\t\tSELECT * FROM {$wpdb->comments}\r\r\n\t\t\t\tJOIN {$wpdb->prefix}icl_translations \r\r\n\t\t\t\tON {$wpdb->comments}.comment_post_id = {$wpdb->prefix}icl_translations.element_id \r\r\n\t\t\t\tAND {$wpdb->prefix}icl_translations.element_type='post_post' \r\r\n\t\t\t\tWHERE comment_approved = '1' \r\r\n\t\t\t\tAND language_code = '" . $sitepress->get_current_language() . "' \r\r\n\t\t\t\tORDER BY comment_date_gmt DESC LIMIT {$comments_count}";
        } else {
            $sql = "\r\r\n\t\t\t\tSELECT * FROM {$wpdb->comments} \r\r\n\t\t\t\tWHERE comment_approved = '1' \r\r\n\t\t\t\tAND comment_type not in ('pingback','trackback') \r\r\n\t\t\t\tORDER BY comment_date_gmt \r\r\n\t\t\t\tDESC LIMIT {$comments_count}";
        }
        if (!($comments = wp_cache_get('recent_comments', 'widget'))) {
            $comments = $wpdb->get_results($sql);
            wp_cache_add('recent_comments', $comments, 'widget');
        }
        $comments = array_slice((array) $comments, 0, $comments_count);
        ?>

		<?php 
        echo $before_widget;
        ?>

			<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

		<ul class="comments-custom unstyled"><?php 
        if ($comments) {
            foreach ((array) $comments as $comment) {
                ?>

			
			<li class="comments-custom_li">
				<?php 
                if (function_exists('get_avatar') && $display_avatar != 'off') {
                    echo '<figure class="thumbnail featured-thumbnail">';
                    echo get_avatar(get_the_author_meta('email', $id = get_comment(get_comment_ID())->user_id), $avatar_size);
                    /* This avatar is the user's gravatar (http://gravatar.com) based on their administrative email address */
                    echo '</figure>';
                }
                ?>

				<?php 
                if ($display_post_title != 'off') {
                    $post_ID = $comment->comment_post_ID;
                    $title_format = "";
                    if ($meta_format == "icons") {
                        $title_format = '<i class="icon-link"></i>';
                    } else {
                        if ($meta_format == "labels") {
                            $title_format = '<span class="ladle">' . theme_locals("comment_in") . ':</span> ';
                        }
                    }
                    echo '<div class="meta_format">' . $title_format . '<h4 class="comments-custom_h_title"><a href="' . post_permalink($post_ID) . '" title="' . get_post($post_ID)->post_title . '">' . get_post($post_ID)->post_title . '</a></h4></div>';
                }
                ?>

				<?php 
                if ($display_author_name != 'off') {
                    $title_author_name = "";
                    if ($meta_format == "icons") {
                        $title_author_name = '<i class="icon-user"></i>';
                    } else {
                        if ($meta_format == "labels") {
                            $title_author_name = '<span class="ladle">' . theme_locals("comment_author") . ':</span> ';
                        }
                    }
                    echo '<div class="meta_format">' . $title_author_name . '<h4 class="comments-custom_h_author">' . $comment->comment_author . '</h4></div>';
                }
                ?>

				<?php 
                if ($display_date != 'off') {
                    $title_date = "";
                    if ($meta_format == "icons") {
                        $title_date = '<i class="icon-calendar"></i>';
                    } else {
                        if ($meta_format == "labels") {
                            $title_date = '<span class="ladle">' . theme_locals("comment_date") . ':</span> ';
                        }
                    }
                    $comment_date = get_comment_date();
                    $comment_time = get_comment_time();
//.........这里部分代码省略.........
开发者ID:poolieweb,项目名称:LawStaticAthena,代码行数:101,代码来源:my-comment-widget.php

示例12: flush_post

 /**
  * Flushes post cache
  *
  * @param integer $post_id
  * @return boolean
  */
 function flush_post($post_id = null)
 {
     if (!$post_id) {
         $post_id = $this->_detect_post_id();
     }
     if ($post_id) {
         $uris = array();
         $domain_url = w3_get_domain_url();
         $feeds = $this->_config->get_array('pgcache.purge.feed.types');
         if ($this->_config->get_boolean('pgcache.purge.terms') || $this->_config->get_boolean('pgcache.purge.feed.terms')) {
             $taxonomies = get_post_taxonomies($post_id);
             $terms = nxt_get_post_terms($post_id, $taxonomies);
         }
         switch (true) {
             case $this->_config->get_boolean('pgcache.purge.author'):
             case $this->_config->get_boolean('pgcache.purge.archive.daily'):
             case $this->_config->get_boolean('pgcache.purge.archive.monthly'):
             case $this->_config->get_boolean('pgcache.purge.archive.yearly'):
             case $this->_config->get_boolean('pgcache.purge.feed.author'):
                 $post = get_post($post_id);
         }
         /**
          * Home URL
          */
         if ($this->_config->get_boolean('pgcache.purge.home')) {
             $home_path = w3_get_home_path();
             $site_path = w3_get_site_path();
             $uris[] = $home_path;
             if ($site_path != $home_path) {
                 $uris[] = $site_path;
             }
         }
         /**
          * Post URL
          */
         if ($this->_config->get_boolean('pgcache.purge.post')) {
             $post_link = post_permalink($post_id);
             $post_uri = str_replace($domain_url, '', $post_link);
             $uris[] = $post_uri;
         }
         /**
          * Post comments URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.comments') && function_exists('get_comments_pagenum_link')) {
             $comments_number = get_comments_number($post_id);
             $comments_per_page = get_option('comments_per_page');
             $comments_pages_number = @ceil($comments_number / $comments_per_page);
             for ($pagenum = 1; $pagenum <= $comments_pages_number; $pagenum++) {
                 $comments_pagenum_link = $this->_get_comments_pagenum_link($post_id, $pagenum);
                 $comments_pagenum_uri = str_replace($domain_url, '', $comments_pagenum_link);
                 $uris[] = $comments_pagenum_uri;
             }
         }
         /**
          * Post author URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.author') && $post) {
             $posts_number = count_user_posts($post->post_author);
             $posts_per_page = get_option('posts_per_page');
             $posts_pages_number = @ceil($posts_number / $posts_per_page);
             $author_link = get_author_link(false, $post->post_author);
             $author_uri = str_replace($domain_url, '', $author_link);
             for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                 $author_pagenum_link = $this->_get_pagenum_link($author_uri, $pagenum);
                 $author_pagenum_uri = str_replace($domain_url, '', $author_pagenum_link);
                 $uris[] = $author_pagenum_uri;
             }
         }
         /**
          * Post terms URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.terms')) {
             $posts_per_page = get_option('posts_per_page');
             foreach ($terms as $term) {
                 $term_link = get_term_link($term, $term->taxonomy);
                 $term_uri = str_replace($domain_url, '', $term_link);
                 $posts_pages_number = @ceil($term->count / $posts_per_page);
                 for ($pagenum = 1; $pagenum <= $posts_pages_number; $pagenum++) {
                     $term_pagenum_link = $this->_get_pagenum_link($term_uri, $pagenum);
                     $term_pagenum_uri = str_replace($domain_url, '', $term_pagenum_link);
                     $uris[] = $term_pagenum_uri;
                 }
             }
         }
         /**
          * Daily archive URLs
          */
         if ($this->_config->get_boolean('pgcache.purge.archive.daily') && $post) {
             $post_date = strtotime($post->post_date);
             $post_year = gmdate('Y', $post_date);
             $post_month = gmdate('m', $post_date);
             $post_day = gmdate('d', $post_date);
             $posts_per_page = get_option('posts_per_page');
             $posts_number = $this->_get_archive_posts_count($post_year, $post_month, $post_day);
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass,代码行数:101,代码来源:PgCacheFlush.php

示例13: query_posts

<?php

if (is_home()) {
    query_posts('posts_per_page=1');
    if (have_posts()) {
        the_post();
        header('Location: ' . post_permalink());
    }
}
?>
<html>
<head>
<title><?php 
bloginfo('name');
?>
</title>
<link rel="stylesheet" href="<?php 
bloginfo('stylesheet_url');
?>
" type="text/css" media="screen, print">
</head>
<body>
    <div class="bd">
        <div class="entries">
        <?php 
if (have_posts()) {
    ?>
            <?php 
    while (have_posts()) {
        the_post();
        ?>
开发者ID:jueseph,项目名称:wp-themes,代码行数:31,代码来源:index.php

示例14: get_cat_id

template name: Deprecated - Trending old style
* The template for displaying our "in focus" view.
* In this version we just show the most recent 'in focus' post
* @package Independent Publisher
* @since   Independent Publisher 1.0
*/
$pageBodyID = "trending";
$trendingCatID = get_cat_id('Trending');
/**** GET A SPECIAL PERMALINK FOR THE TWITTER AND FB SHARE BUTTONS *****/
$qParams = array('post_type' => array('post'), 'posts_per_page' => 1, 'orderby' => 'post_date', 'order' => 'desc', 'cat' => $trendingCatID);
//echo "catid " . $cat_id . "<BR>";
query_posts($qParams);
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $trendingPostPermalink = post_permalink(get_the_id());
        $ogUrl = $trendingPostPermalink;
    }
}
rewind_posts();
/***** DONE GETTING SPECIAL PERMALINK ******/
get_header();
?>
 
	<!-- temporary fix -->
	<div id="logoOnPostPages">
		<a class="site-logo" href="https://africa.rizing.org/" title="Africa Rizing" rel="home">
			<img class="no-grav" src="https://africa.rizing.org/wp-content/uploads/2015/10/cropped-Rize-socialprofiles_500.png" height="501" width="501" alt="Africa Rizing">
		</a>
		<h1 class="site-title">
			<a href="https://africa.rizing.org/" title="Africa Rizing" rel="home">Africa <span class="orangeHighlight">Rizing</span></a>
开发者ID:BBGInnovate,项目名称:rizeWP,代码行数:31,代码来源:page-deprecated-trending.php

示例15: post_permalink

								</div>
								<h4><a href="<?php 
            echo post_permalink($post->ID);
            ?>
"><?php 
            echo $post->post_title;
            ?>
</a></h4>
								<div class="description">
									<?php 
            $content = self::ya_trim_words($post->post_content, $length, ' ');
            echo $content;
            ?>
								</div>
								<div class="readmore"><a href="<?php 
            echo post_permalink($post->ID);
            ?>
" title="Read more" ><?php 
            _e('Read more', 'smartaddons');
            ?>
</a></div>
							</div>
						</div>
					</div>
				</div>
				<?php 
        }
        ?>
			<?php 
    }
    ?>
开发者ID:junibrosas,项目名称:shoppingyourway,代码行数:31,代码来源:theme1.php


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