本文整理汇总了PHP中wp_title_rss函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_title_rss函数的具体用法?PHP wp_title_rss怎么用?PHP wp_title_rss使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_title_rss函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
*
* @package WordPress
*/
header('Content-Type: ' . feed_content_type('atom') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
/** This action is documented in wp-includes/feed-rss2.php */
do_action('rss_tag_pre', 'atom');
?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en" >
<?php
do_action('atom_ns');
?>
<title type="text"><?php
bloginfo_rss('name');
wp_title_rss();
?>
</title> <subtitle type="text"><?php
bloginfo_rss("description");
?>
</subtitle> <updated><?php
echo mysql2date('Y-m-d\\TH:i:s\\Z', get_lastpostmodified('GMT'), false);
?>
</updated> <link rel="alternate" type="<?php
bloginfo_rss('html_type');
?>
" href="<?php
bloginfo_rss('url');
?>
" /> <id><?php
bloginfo_rss('url');
示例2: create_my_customfeed
function create_my_customfeed()
{
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
$more = 1;
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
$mfgigcal_options = get_option('mfgigcal_settings');
if (WPLANG == "") {
$language = "en-us";
} else {
$language = WPLANG;
}
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:mfgigcal="http://wordpress.org/extend/plugins/mf-gig-calendar/"
<?php
do_action('rss2_ns');
?>
>
<channel>
<title><?php
bloginfo_rss('name');
wp_title_rss();
?>
</title>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<link><?php
bloginfo_rss('url');
?>
</link>
<description>MF Gig Cal Events</description>
<lastBuildDate><?php
echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
?>
</lastBuildDate>
<language><?php
echo $language;
?>
</language>
<sy:updatePeriod><?php
echo apply_filters('rss_update_period', 'hourly');
?>
</sy:updatePeriod>
<sy:updateFrequency><?php
echo apply_filters('rss_update_frequency', '1');
?>
</sy:updateFrequency>
<?php
do_action('rss2_head');
?>
<?php
//get events from db
global $wpdb;
$mfgigcal_table = $wpdb->prefix . "mfgigcal";
$mfgigcal_settings = get_option('mfgigcal_settings');
// get the dates
$today = date("Y-m-d");
$sql = "SELECT * FROM {$mfgigcal_table} WHERE end_date >= '{$today}' ORDER BY start_date";
$mfgigcal_events = $wpdb->get_results($sql);
if (!empty($mfgigcal_events)) {
foreach ($mfgigcal_events as $mfgigcal_event) {
?>
<item>
<guid isPermaLink="false"><?php
echo $mfgigcal_settings['calendar_url'];
?>
?event_id=<?php
echo $mfgigcal_event->id;
?>
</guid>
<title><![CDATA[<?php
echo $mfgigcal_event->title;
?>
]]></title>
<link><?php
echo $mfgigcal_settings['calendar_url'];
?>
?event_id=<?php
echo $mfgigcal_event->id;
?>
</link>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s +0000', $mfgigcal_event->pub_date, false);
?>
</pubDate>
<description><![CDATA[<p><?php
echo mfgigcal_feed_FormatDate($mfgigcal_event->start_date, $mfgigcal_event->end_date);
//.........这里部分代码省略.........
示例3: header
header('Content-type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;
?>
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" -->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
<?php do_action('rss2_ns'); ?>
>
<channel>
<title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
<link><?php bloginfo_rss('url') ?></link>
<description><?php bloginfo_rss("description") ?></description>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
<language><?php echo get_option('rss_language'); ?></language>
<?php do_action('rss2_head'); ?>
<?php while( have_posts()) : the_post(); ?>
<item>
<title><?php the_title_rss() ?></title>
<link><?php permalink_single_rss() ?></link>
<comments><?php comments_link(); ?></comments>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
<dc:creator><?php the_author() ?></dc:creator>
<?php the_category_rss() ?>
示例4: popular_rss
function popular_rss()
{
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
preg_match('{(\\d{1,2})/(\\d{1,2})/popular.xml}', $_SERVER['REQUEST_URI'], $match);
$max_posts = (int) $match[1];
if ($max_posts < 1 || $max_posts > 25) {
wp_die('Max popular posts should be between 1 and 25.');
}
$days = (int) $match[2];
if ($days < 1 || $days > 90) {
wp_die('The no. of days should be between 1 and 90.');
}
if (function_exists('wpcom_vip_load_helper_stats')) {
wpcom_vip_load_helper_stats();
}
$feed_max_posts = $max_posts + 20;
$popular_data = wpcom_vip_top_posts_array($days, $feed_max_posts);
//print_r ($popular_data);
foreach ($popular_data as $p) {
if ($p["post_id"] != 0) {
$popular_posts[] = $p["post_id"];
}
}
$the_query = new WP_Query(array('post__in' => $popular_posts, 'orderby' => 'post__in', 'posts_per_page' => $max_posts, 'ignore_sticky_posts' => 1));
echo '<?xml version="1.0"?>';
?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title><?php
bloginfo_rss('name');
wp_title_rss();
?>
</title>
<link><?php
bloginfo_rss('url');
?>
</link>
<description><?php
bloginfo_rss("description");
?>
</description>
<image>
<url><?php
echo home_url();
?>
/wp-content/themes/vip/jptechcrunch/images/site-logo-small.png</url>
<title><?php
bloginfo_rss('name');
wp_title_rss();
?>
</title>
<link><?php
bloginfo_rss('url');
?>
</link>
</image>
<language><?php
echo get_option('rss_language');
?>
</language>
<copyright>Copyright <?php
echo date('Y');
?>
TechCrunch The contents of this feed are available for non-commercial use only.</copyright>
<?php
global $post;
while ($the_query->have_posts()) {
$the_query->the_post();
?>
<item>
<title><![CDATA[<?php
the_title_rss();
?>
]]></title>
<link><![CDATA[<?php
the_permalink_rss();
?>
]]></link>
<guid isPermaLink="true"><![CDATA[<?php
the_permalink_rss();
?>
]]></guid>
<description><![CDATA[<?php
if (is_single()) {
if (get_post_meta($post->ID, '_tc_post_type', true) != 'simplepost' && has_post_thumbnail()) {
the_post_thumbnail('full');
}
the_content();
} else {
echo strip_tags(get_the_excerpt());
}
?>
]]></description>
<?php
if ($thumb = tc_get_post_image($post, 'full')) {
?>
<enclosure url="<?php
echo esc_url($thumb);
?>
" length="<?php
//.........这里部分代码省略.........
示例5: header
<?php
header('Content-type: application/atom+xml; charset=' . get_option('blog_charset'), true);
$more = 1;
?>
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
<feed
xmlns="http://www.w3.org/2005/Atom"
xmlns:thr="http://purl.org/syndication/thread/1.0"
xml:lang="<?php echo get_option('rss_language'); ?>"
xml:base="<?php bloginfo_rss('home') ?>/wp-atom.php"
<?php do_action('atom_ns'); ?>
>
<title type="text"><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></updated>
<generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
<link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
<id><?php bloginfo('atom_url'); ?></id>
<link rel="self" type="application/atom+xml" href="<?php bloginfo('atom_url'); ?>" />
<?php do_action('atom_head'); ?>
<?php while (have_posts()) : the_post(); ?>
<entry>
<author>
<name><?php the_author() ?></name>
<uri><?php the_author_url()?></uri>
</author>
<title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title>
示例6: render_output
function render_output($wgt_miss, $wgt_count, $wgt_format, $wgt_white)
{
global $switched;
global $wpdb;
$table_prefix = $wpdb->base_prefix;
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
if (!isset($wgt_miss) || $wgt_miss == '') {
$wgt_miss = array();
}
$white = 0;
if (isset($wgt_white) && $wgt_white != '' && count($wgt_white) > 0 && $wgt_white[0] && $wgt_white[0] != '') {
$white = 1;
}
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/" >
<channel>
<title><?php
bloginfo_rss('name');
wp_title_rss();
?>
</title>
<link><?php
self_link();
?>
</link>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<description><?php
bloginfo_rss("description");
?>
</description>
<language><?php
echo get_option('rss_language');
?>
</language>
<sy:updatePeriod><?php
echo apply_filters('rss_update_period', 'hourly');
?>
</sy:updatePeriod>
<sy:updateFrequency><?php
echo apply_filters('rss_update_frequency', '1');
?>
</sy:updateFrequency><?php
$sqlstr = '';
$blog_list = get_blog_list(0, 'all');
if ($white == 0 && !in_array(1, $wgt_miss) || $white == 1 && in_array(1, $wgt_white)) {
$sqlstr = "SELECT 1 as blog_id, id, post_date_gmt, post_type from " . $table_prefix . "posts where post_status = 'publish' and post_type = 'post' ";
}
$uni = '';
foreach ($blog_list as $blog) {
if ($white == 0 && !in_array($blog['blog_id'], $wgt_miss) && $blog['blog_id'] != 1 || $white == 1 && $blog['blog_id'] != 1 && in_array($blog['blog_id'], $wgt_white)) {
if ($sqlstr != '') {
$uni = ' union ';
}
$sqlstr .= $uni . " SELECT " . $blog['blog_id'] . " as blog_id, id, post_date_gmt, post_type from " . $table_prefix . $blog['blog_id'] . "_posts where post_status = 'publish' and post_type = 'post' ";
}
}
$limit = '';
if ((int) $wgt_count > 0) {
$limit = ' LIMIT 0, ' . (int) $wgt_count;
} else {
$limit = ' LIMIT 0, 100';
}
$sqlstr .= " ORDER BY post_date_gmt desc " . $limit;
$post_list = $wpdb->get_results($sqlstr, ARRAY_A);
foreach ($post_list as $post) {
$txt = $wgt_format == '' ? '{excerpt}' : $wgt_format;
$p = get_blog_post($post["blog_id"], $post["id"]);
$ex = $p->post_excerpt;
//if (!isset($ex) || trim($ex) == '')
//$ex = substr(strip_tags($p->post_content), 0, 65) . '...';
echo "\r";
?>
<item>
<title><![CDATA[<?php
echo $p->post_title;
?>
]]></title>
<link><?php
echo get_blog_permalink($post["blog_id"], $post["id"]);
?>
</link>
<dc:creator><?php
echo get_userdata($p->post_author)->nickname;
?>
</dc:creator>
<guid isPermaLink="false"><?php
echo $p->guid;
?>
</guid>
<pubDate><?php
//.........这里部分代码省略.........