Example #1
0
    /**
     * Display the Open Graph meta tags.
     * Add more to this if needed.
     *
     * See: https://developers.facebook.com/docs/sharing/webmasters and http://ogp.me/
     */
    function skeleton_og_meta_tags()
    {
        if (is_single() || is_page()) {
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
        <meta name="og:description" content="<?php 
                    the_excerpt_rss();
                    ?>
">
        <meta name="og:image" content="<?php 
                    echo skeleton_get_thumbnail_src(get_post_thumbnail_id());
                    ?>
">
    <?php 
                }
            }
        } elseif (is_home()) {
            ?>
        <meta name="og:description" content="<?php 
            bloginfo('description');
            ?>
">
    <?php 
        }
    }
Example #2
0
function lj_description()
{
    if (is_single() || is_page()) {
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                the_excerpt_rss();
            }
        }
    } else {
        if (is_home()) {
            lj_title();
        }
    }
}
function osfeeds_item()
{
    global $osfeeds_gallery_lookup;
    $media = array();
    // Honor the feed settings. Don't include any media that isn't in the feed.
    if (!strlen(get_the_content())) {
        $content = the_excerpt_rss();
    } else {
        // When a gallery in a post is processed wp_get_attachment_link is run for
        // each picture. Get the $id for each picture.
        // $lookup = ('dom.com/wp-content...' => 13,'dom.com/wp-content...' => 16)
        add_filter('wp_get_attachment_link', 'osfeeds_gallery_lookup', 10, 5);
        $content = apply_filters('the_content', get_the_content());
        remove_filter('wp_get_attachment_link', 'osfeeds_gallery_lookup', 10, 5);
        $lookup = $osfeeds_gallery_lookup;
        unset($osfeeds_gallery_lookup);
    }
    // Use featured image if it has one.
    global $post;
    if (has_post_thumbnail($post->ID)) {
        // Get featured image as thumbnail if possible, else use attachment
        // thumbnail/full
        //$thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'thumbnail');
        //if (!empty($thumbnail))
        //  $media[]['thumbnail']['attr']['url'] = $thumbnail[0];
        // Make the featured image the first media:content item.
        $thumbnail_id = get_post_thumbnail_id($post->ID);
        $featured_src = wp_get_attachment_image_src($thumbnail_id, 'full');
        $attributes = osfeeds_attachment_attributes($thumbnail_id, $featured_src[0]);
        $featured_item = assemble_featured($featured_src[0], $attributes);
        $media[] = $featured_item;
    }
    // Extract img tag attributes
    $images = 0;
    if (preg_match_all('/<img (.+?)>/', $content, $matches)) {
        foreach ($matches[1] as $attrs) {
            $item = $img = array();
            // Construct $img array from <img> attributes
            // Produces $img = ('alt' => 'val1', 'src' => 'val2', 'title' => 'val3', etc)
            foreach (wp_kses_hair($attrs, array('http')) as $attr) {
                $img[$attr['name']] = $attr['value'];
            }
            // Get absolute URL of image
            if (!isset($img['src'])) {
                continue;
            }
            $img['src'] = osfeeds_url($img['src']);
            // Skip emoticons
            if (isset($img['class']) && false !== strpos($img['class'], 'wp-smiley')) {
                continue;
            }
            // If the image scraped from the content is found in $lookup that means
            // its part of a gallery so use that id. Otherwise grab the id from the
            // css class
            $id = false;
            if (isset($lookup[$img['src']])) {
                $id = $lookup[$img['src']];
            } elseif (isset($img['class']) && preg_match('/wp-image-(\\d+)/', $img['class'], $match)) {
                $id = $match[1];
            }
            // It's an attachment, so we will get the URLs, title, and description
            // from functions
            if ($id) {
                $img = array_merge($img, osfeeds_attachment_attributes($id, $img['src']));
            }
            // Populate thumbnail on first iteration of image search if not already
            // filled from featured image
            //if (++$images == 1) {
            //  if (!empty($thumbnail))
            //    $img['thumbnail'] = $thumbnail[0];
            //  elseif (isset($img['thumbnail']))
            //    $media[]['thumbnail']['attr']['url'] = $img['thumbnail'];
            //  else
            //    $media[]['thumbnail']['attr']['url'] = $img['src'];
            //}
            // If first image of gallery/post is the same as featured image then it
            // is already added so don't add again
            if ($featured_src == $img['src']) {
                continue;
            }
            // From this point on just assemble the image being iterated over,
            // whether that be part of a gallery or not into <media:content> tags
            $item = assemble_item($img);
            $media[] = $item;
        }
    }
    $media = apply_filters('osfeeds_media', $media);
    osfeeds_print($media);
}
        start_wp();
        ?>
        <item>
            <title><?php 
        the_title_rss();
        ?>
</title>
<?php 
        // we might use this in the future, but not now, that's why it's commented in PHP
        // so that it doesn't appear at all in the RSS
        //          echo "<category>"; the_category_unicode(); echo "</category>";
        $more = 1;
        if (get_settings('rss_use_excerpt')) {
            ?>
            <description><?php 
            the_excerpt_rss(get_settings('rss_excerpt_length'), get_settings('rss_encoded_html'));
            ?>
</description>
<?php 
        } else {
            // use content
            ?>
            <description><?php 
            the_content_rss('', 0, '', get_settings('rss_excerpt_length'), get_settings('rss_encoded_html'));
            ?>
</description>
<?php 
        }
        // end else use content
        ?>
            <link><?php 
	<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() ?>

		<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php else : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
	<?php if ( strlen( $post->post_content ) > 0 ) : ?>
		<content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
	<?php else : ?>
		<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
	<?php endif; ?>
<?php endif; ?>
		<wfw:commentRss><?php echo comments_rss(); ?></wfw:commentRss>
<?php rss_enclosure(); ?>
	<?php do_action('rss2_item'); ?>
	</item>
	<?php endwhile; ?>
</channel>
</rss>
}

header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);
$more = 1;

?>
<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
<!-- generator="wordpress/<?php echo $wp_version ?>" -->
<rss version="0.92">
<channel>
	<title><?php bloginfo_rss('name') ?></title>
	<link><?php bloginfo_rss('url') ?></link>
	<description><?php bloginfo_rss('description') ?></description>
	<lastBuildDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), 0); ?></lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language><?php echo get_option('rss_language'); ?></language>

<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
	<item>
		<title><?php the_title_rss() ?></title>
<?php if (get_settings('rss_use_excerpt')) { ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php } else { // use content ?>
		<description><?php the_content_rss('', 0, '', get_settings('rss_excerpt_length')) ?></description>
<?php } ?>
		<link><?php permalink_single_rss() ?></link>
	</item>
<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
</channel>
</rss>
	function get_entry($postID, $post_type = 'post') {
		log_app('function',"get_entry($postID, '$post_type')");
		ob_start();
		global $posts, $post, $wp_query, $wp, $wpdb, $blog_id, $post_cache;
		switch($post_type) {
			case 'post':
				$varname = 'p';
				break;
			case 'attachment':
				$varname = 'attachment_id';
				break;
		}
		query_posts($varname . '=' . $postID);
		if ( have_posts() ) : while ( have_posts() ) : the_post();
		$post = $GLOBALS['post'];
		?>
		<?php log_app('$post',print_r($GLOBALS['post'],true)); ?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://purl.org/atom/app#" xml:lang="<?php echo get_option('rss_language'); ?>">
	<id><?php the_guid($post->ID); ?></id>
	<title type="html"><![CDATA[<?php the_title_rss() ?>]]></title>

	<updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated>
	<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
	<app:control>
		<app:draft><?php echo ($GLOBALS['post']->post_status == 'draft' ? 'yes' : 'no') ?></app:draft>
	</app:control>
	<author>
		<name><?php the_author()?></name>
		<email><?php the_author_email()?></email>
		<uri><?php the_author_url()?></uri>
	</author>
<?php if($GLOBALS['post']->post_type == 'attachment') { ?>
	<link rel="edit" href="<?php $this->the_entry_url() ?>" />
	<link rel="edit-media" href="<?php $this->the_media_url() ?>" />
	<content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/>
<?php } else { ?>
	<link href="<?php permalink_single_rss() ?>" />
	<link rel="edit" href="<?php $this->the_entry_url() ?>" />
<?php } ?>
<?php foreach(get_the_category() as $category) { ?>
	<category scheme="<?php bloginfo_rss('home') ?>" term="<?php echo $category->cat_name?>" />
	<summary type="html"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php }
	if ( strlen( $GLOBALS['post']->post_content ) ) : ?>
	<content type="html"><![CDATA[<?php echo get_the_content('', 0, '') ?>]]></content>
<?php endif; ?>
</entry>
<?php
		$entry = ob_get_contents();
		break;
		endwhile;
		else:
			$this->auth_required(__("Access Denied."));
		endif;
		ob_end_clean();

		log_app('get_entry returning:',$entry);
		return $entry; 
	}
Example #8
0
function podcasting_add_itunes_item()
{
    if ('podcast' == get_query_var('feed')) {
        $podcast_format = '' == get_query_var('format') ? 'default-format' : get_query_var('format');
        $enclosures = get_post_custom_values('enclosure');
        foreach ($enclosures as $enclosure) {
            $enclosure_itunes = explode("\n", $enclosure);
            $enclosure_itunes = unserialize($enclosure_itunes[3]);
            if ($enclosure_itunes['format'] == $podcast_format) {
                break;
            }
        }
        // iTunes summary
        ob_start();
        the_content();
        $itunes_summary = ob_get_contents();
        ob_end_clean();
        echo '<itunes:summary>' . podcasting_limit_string_length(ent2ncr(strip_tags(stripslashes($itunes_summary))), 4000) . '</itunes:summary>' . "\n";
        // iTunes subtitle
        ob_start();
        the_excerpt_rss();
        $itunes_subtitle = ob_get_contents();
        ob_end_clean();
        echo '<itunes:subtitle>' . podcasting_limit_string_length(ent2ncr(strip_tags(stripslashes($itunes_subtitle))), 255) . '</itunes:subtitle>' . "\n";
        // iTunes author
        if ('' != $enclosure_itunes['author']) {
            echo '<itunes:author>' . ent2ncr(stripslashes($enclosure_itunes['author'])) . '</itunes:author>' . "\n";
        }
        // iTunes duration
        if ('' != $enclosure_itunes['length']) {
            echo '<itunes:duration>' . ent2ncr(stripslashes($enclosure_itunes['length'])) . '</itunes:duration>' . "\n";
        }
        // iTunes keywords
        if ('' != $enclosure_itunes['keywords']) {
            echo '<itunes:keywords>' . ent2ncr(stripslashes($enclosure_itunes['keywords'])) . '</itunes:keywords>' . "\n";
        }
        // iTunes explicit
        if ('' != $enclosure_itunes['explicit']) {
            echo '<itunes:explicit>' . $enclosure_itunes['explicit'] . '</itunes:explicit>' . "\n";
        }
    }
}
	<tagline><?php bloginfo_rss("description") ?></tagline>
	<modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT')); ?></modified>
	<copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></copyright>
	<generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
	
	<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
	<entry>
	  	<author>
			<name><?php the_author() ?></name>
		</author>
		<title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
		<link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
		<id><?php the_guid(); ?></id>
		<modified><?php the_time('Y-m-d\TH:i:s\Z'); ?></modified>
		<issued>  <?php the_time('Y-m-d\TH:i:s\Z'); ?></issued>
		<?php the_category_rss('rdf') ?>
		<summary type="<?php bloginfo('html_type'); ?>" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php if (!get_settings('rss_use_excerpt')) : ?>
	<?php if ( strlen( $post->post_content ) ) : ?>
		<content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
	<?php else : ?>
		<content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></content>
	<?php endif; ?>
<?php else : ?>
		<content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_excerpt_rss() ?>]]></content>
<?php endif; ?>
<?php rss_enclosure(); ?>
	</entry>
	<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
</feed>
</id>
		<modified><?php 
        the_time('Y-m-d\\TH:i:s\\Z');
        ?>
</modified>
		<issued><?php 
        the_time('Y-m-d\\TH:i:s\\Z');
        ?>
</issued>
		<?php 
        the_category_rss('rdf');
        $more = 1;
        if ($rss_use_excerpt) {
            ?>
		<summary type="text/html"><?php 
            the_excerpt_rss($rss_excerpt_length, 2);
            ?>
</summary>
<?php 
        } else {
            // use content
            ?>
		<summary type="text/html"><?php 
            the_content_rss('', 0, '', $rss_excerpt_length, 2);
            ?>
</summary>
<?php 
        }
        // end else use content
        ?>
		<content type="text/html" mode="escaped" xml:base="<?php 
Example #11
0
function seometa_add_meta()
{
    if (get_option('seo_meta_tags[description]') != '') {
        if (is_single() || is_page()) {
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
<meta name="description" content="<?php 
                    the_excerpt_rss();
                    ?>
" />
<?php 
                }
            }
        } elseif (is_home()) {
            ?>
<meta name="description" content="<?php 
            echo get_option('seo_meta_tags[description]');
            ?>
" />
<?php 
        }
    }
    if (get_option('seo_meta_tags[keywords]') != '') {
        ?>
<meta name="keywords" content="<?php 
        echo get_option('seo_meta_tags[keywords]');
        ?>
" />
<?php 
    }
}
Example #12
0
function cherry_wp_head()
{
    ?>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<script type="text/javascript">
var cherry_url = '<?php 
    bloginfo('template_url');
    ?>
';
</script>
<!--[if lt IE 9]>
<script type='text/javascript' src='<?php 
    echo BD_JS;
    ?>
/selectivizr-min.js'></script>
<script type='text/javascript' src='<?php 
    echo BD_JS;
    ?>
/html5.js'></script>
<![endif]-->
<!--[if IE 8]>
<link href="<?php 
    echo BD_CSS;
    ?>
/ie.css" rel="stylesheet" type="text/css" media="all" />
<![endif]-->
<!--[if IE 7]>
<link href="<?php 
    echo BD_CSS;
    ?>
/ie.css" rel="stylesheet" type="text/css" media="all" />
<![endif]-->
<?php 
    if (bdayh_get_option('disable_responsive')) {
        ?>
<meta name="viewport" content="width=1045" />
<?php 
    } else {
        ?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php 
    }
    if (bdayh_get_option('seo_settings') == 1) {
        if (is_home() || is_front_page()) {
            ?>
<meta name="description" content="<?php 
            bloginfo('description');
            ?>
" />
<meta name="keywords" content="<?php 
            echo stripslashes(bdayh_get_option('seo_keywords'));
            ?>
" />
<?php 
        } elseif (is_single() || is_page()) {
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
<meta name="description" content="<?php 
                    the_excerpt_rss();
                    ?>
" />
<?php 
                    csv_tags();
                }
            }
            wp_reset_query();
        }
    }
    if (bdayh_get_option('skin_color') == 'red') {
    } else {
    }
    if (bdayh_get_option('skin_color') == 'blue') {
        ?>
    <link href="<?php 
        echo BD_CSS;
        ?>
/blue.css" rel="stylesheet" type="text/css" media="all" />
<?php 
    } else {
    }
    if (bdayh_get_option('skin_color') == 'green') {
        ?>
    <link href="<?php 
        echo BD_CSS;
        ?>
/green.css" rel="stylesheet" type="text/css" media="all" />
<?php 
    } else {
    }
    if (bdayh_get_option('skin_color') == 'rose') {
        ?>
    <link href="<?php 
        echo BD_CSS;
        ?>
/rose.css" rel="stylesheet" type="text/css" media="all" />
<?php 
    } else {
    }
    if (bdayh_get_option('skin_color') == 'orange') {
        ?>
    <link href="<?php 
        echo BD_CSS;
        ?>
/orange.css" rel="stylesheet" type="text/css" media="all" />
<?php 
    } else {
    }
    if (bdayh_get_option('skin_color') == 'gray') {
        ?>
    <link href="<?php 
        echo BD_CSS;
        ?>
/gray.css" rel="stylesheet" type="text/css" media="all" />
<?php 
    } else {
    }
    echo stripslashes(bdayh_get_option('header_code'));
    include BD_FU . '/custom-css.php';
}
	xml:lang="<?php echo get_option('rss_language'); ?>"
	<?php do_action('atom_ns'); ?>
>
	<title><?php bloginfo_rss('name') ?></title>
	<link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
	<tagline><?php bloginfo_rss("description") ?></tagline>
	<modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified>
	<copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright>
	<generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
	<?php do_action('atom_head'); ?>
	<?php while (have_posts()) : the_post(); ?>
	<entry>
		<author>
			<name><?php the_author() ?></name>
		</author>
		<title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
		<link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
		<id><?php the_guid(); ?></id>
		<modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified>
		<issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued>
		<?php the_category_rss('rdf') ?>
		<summary type="<?php bloginfo('html_type'); ?>" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php if ( !get_option('rss_use_excerpt') ) : ?>
		<content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
<?php endif; ?>
<?php rss_enclosure(); ?>
<?php do_action('atom_entry'); ?>
	</entry>
	<?php endwhile ; ?>
</feed>
	<admin:generatorAgent rdf:resource="http://wordpress.org/?v=<?php echo $wp_version ?>"/>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
	<?php do_action('rdf_header'); ?>
	<items>
		<rdf:Seq>
		<?php while (have_posts()): the_post(); ?>
			<rdf:li rdf:resource="<?php permalink_single_rss() ?>"/>
		<?php endwhile; ?>
		</rdf:Seq>
	</items>
</channel>
<?php rewind_posts(); while (have_posts()): the_post(); ?>
<item rdf:about="<?php permalink_single_rss() ?>">
	<title><?php the_title_rss() ?></title>
	<link><?php permalink_single_rss() ?></link>
	 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date>
	<dc:creator><?php the_author() ?></dc:creator>
	<?php the_category_rss('rdf') ?>
<?php if (get_option('rss_use_excerpt')) : ?>
	<description><?php the_excerpt_rss() ?></description>
<?php else : ?>
	<description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length'), 2) ?></description>
	<content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
<?php endif; ?>
	<?php do_action('rdf_item'); ?>
</item>
<?php endwhile;  ?>
</rdf:RDF>
    $the_image = get_the_post_thumbnail($post->ID, 'work_post_image');
    if ($the_image) {
        $thumb_id = get_post_thumbnail_id($post->ID);
        $thumb_url = wp_get_attachment_image_src($thumb_id, 'work_post_image', true);
        echo $thumb_url[0];
    } else {
        echo get_template_directory_uri() . '/images/temp_work_img.jpg';
    }
    ?>
</image>
<link><?php 
    echo get_the_permalink($post->ID);
    ?>
</link>
<description><?php 
    htmlspecialchars_decode(the_excerpt_rss());
    ?>
</description>
<category><?php 
    echo strip_tags(get_the_category_list(', '));
    ?>
</category>
<guid><?php 
    echo $post_id;
    ?>
</guid>
</item>
<?php 
}
?>
</channel>
Example #16
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        if (empty($title)) {
            $title = false;
        }
        $display = $instance['display'];
        $twitter = $instance['twitter'] == 1 ? true : false;
        $buzz = $instance['buzz'] == 1 ? true : false;
        $facebook = $instance['facebook'] == 1 ? true : false;
        $digg = $instance['digg'] == 1 ? true : false;
        $delicious = $instance['delicious'] == 1 ? true : false;
        $stumbleupon = $instance['stumbleupon'] == 1 ? true : false;
        $email = $instance['email'] == 1 ? true : false;
        $display = $instance['display'];
        $description = $instance['description'];
        echo $before_widget;
        if ($title) {
            echo $before_title;
            echo $title;
            echo $after_title;
        }
        if ($description != "") {
            echo '<p>' . stripslashes($description) . '</p>';
        }
        ?>
		<ul class="<?php 
        echo $display;
        ?>
">

			<?php 
        if ($twitter) {
            ?>
			<li class="twitter"><a rel="nofollow" href="http://twitter.com/home?status=<?php 
            the_title();
            ?>
 - <?php 
            echo home_url();
            ?>
/?p=<?php 
            the_ID();
            ?>
" title="Twitter"><span class="text">Twitter</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($buzz) {
            ?>
			<li class="google-buzz"><a rel="nofollow" href="http://www.google.com/reader/link?url=<?php 
            the_permalink();
            ?>
&title=<?php 
            the_title();
            ?>
&srcURL=<?php 
            echo home_url();
            ?>
" title="Google Buzz"><span class="text">Google Buzz</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($facebook) {
            ?>
			<li class="facebook"><a rel="nofollow" href="http://www.facebook.com/share.php?u=<?php 
            the_permalink();
            ?>
&t=<?php 
            the_title();
            ?>
" title="Facebook"><span class="text">Facebook</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($delicious) {
            ?>
			<li class="delicious"><a rel="nofollow" href="http://delicious.com/post?url=<?php 
            the_permalink();
            ?>
&title=<?php 
            the_title();
            ?>
&notes=<?php 
            the_excerpt_rss();
            ?>
" title="Delicious"><span class="text">Delicious</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($digg) {
            ?>
			<li class="digg"><a rel="nofollow" href="http://digg.com/submit?phase=2&url=<?php 
            the_permalink();
            ?>
&title=<?php 
            the_title();
            ?>
&bodytext=<?php 
            the_excerpt_rss();
            ?>
" title="Digg"><span class="text">Digg</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($stumbleupon) {
            ?>
			<li class="stumbleupon"><a rel="nofollow" href="http://www.stumbleupon.com/submit?url=<?php 
            the_permalink();
            ?>
&title=<?php 
            the_title();
            ?>
" title="StumbleUpon"><span class="text">StumbleUpon</span></a></li>
		<?php 
        }
        ?>

		<?php 
        if ($email) {
            ?>
			<li class="email"><a rel="nofollow" href="http://www.feedburner.com/fb/a/emailFlare?itemTitle=<?php 
            the_title();
            ?>
&uri=<?php 
            the_permalink();
            ?>
&loc=$loc" title="Email This"><span class="text">Email</span></a></li>
		<?php 
        }
        ?>

		</ul>
<?php 
        echo $after_widget;
    }
/**
 * Output feed content without infinite loop
 *  
**/
function cfct_the_excerpt_feed()
{
    remove_filter('the_excerpt_rss', 'cfct_excerpt_feed');
    the_excerpt_rss();
    add_filter('the_excerpt_rss', 'cfct_excerpt_feed');
}
function seo_meta()
{
    echo '<meta name="title" content="';
    if (function_exists('is_tag') && is_tag()) {
        single_tag_title("Tag Archive for &quot;");
        echo '&quot; - ';
    } elseif (is_archive()) {
        wp_title('');
        echo ' Archive - ';
    } elseif (is_search()) {
        echo 'Search for &quot;' . wp_specialchars($s) . '&quot; - ';
    } elseif (!is_404() && is_single() || is_page()) {
        wp_title('');
        echo ' - ';
    } elseif (is_404()) {
        echo 'Not Found - ';
    }
    if (is_home()) {
        bloginfo('name');
        echo ' - ';
        bloginfo('description');
    } else {
        bloginfo('name');
    }
    if ($paged > 1) {
        echo ' - page ' . $paged;
    }
    echo '" />';
    echo "\n";
    if (is_single() || is_page()) {
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                echo '<meta name="description" content="';
                the_excerpt_rss();
                echo '" />';
            }
        }
    } elseif (is_home()) {
        echo '<meta name="description" content="';
        bloginfo('description');
        echo '" />';
    }
    echo "\n";
    csv_tags();
    echo "\n";
    echo '<title>';
    if (function_exists('is_tag') && is_tag()) {
        single_tag_title("Tag Archive for &quot;");
        echo '&quot; - ';
    } elseif (is_archive()) {
        wp_title('');
        echo ' Archive - ';
    } elseif (is_search()) {
        echo 'Search for &quot;' . wp_specialchars($s) . '&quot; - ';
    } elseif (!is_404() && is_single() || is_page()) {
        wp_title('');
        echo ' - ';
    } elseif (is_404()) {
        echo 'Not Found - ';
    }
    if (is_home()) {
        bloginfo('name');
        echo ' - ';
        bloginfo('description');
    } else {
        bloginfo('name');
    }
    if ($paged > 1) {
        echo ' - page ' . $paged;
    }
    echo '</title>';
}
 /**
  * Test lesson permissions (no more tag, with excerpt).
  */
 public function testLessonContentPermissions3()
 {
     global $post, $more;
     $tmp_more = $more;
     $post = get_post($this->lesson3);
     setup_postdata($post);
     // Test with more set to 0
     $more = 0;
     ob_start();
     the_content();
     $the_content = ob_get_clean();
     $this->assertEquals('This excerpt is visible to everyone.', $the_content);
     // Test with more set to 1.
     $more = 1;
     ob_start();
     the_content();
     $the_content = ob_get_clean();
     $this->assertEquals('This excerpt is visible to everyone.', $the_content);
     // Test RSS excerpt.
     ob_start();
     the_excerpt_rss();
     $rss_excerpt = ob_get_clean();
     $this->assertEquals('This excerpt is visible to everyone.', $rss_excerpt);
     // Reset post data.
     wp_reset_postdata();
     $more = $tmp_more;
 }
	<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>
		<link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
		<id><?php the_guid(); ?></id>
		<updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated>
		<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
		<?php the_category_rss('atom') ?>
		<summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
<?php if ( !get_option('rss_use_excerpt') ) : ?>
		<content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
<?php endif; ?>
<?php atom_enclosure(); ?>
<?php do_action('atom_entry'); ?>
	</entry>
	<?php endwhile ; ?>
</feed>
function tf_events_ical()
{
    // - start collecting output -
    ob_start();
    // - file header -
    header('Content-type: text/calendar');
    header('Content-Disposition: attachment; filename="ical.ics"');
    // - content header -
    ?>
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//<?php 
    the_title();
    ?>
//NONSGML Events //EN
X-WR-CALNAME:<?php 
    the_title();
    _e(' - Events', 'themeforce');
    ?>
X-ORIGINAL-URL:<?php 
    echo the_permalink();
    ?>
X-WR-CALDESC:<?php 
    the_title();
    _e(' - Events', 'themeforce');
    ?>
CALSCALE:GREGORIAN

<?php 
    // - grab date barrier -
    $today6am = strtotime('today 6:00') + get_option('gmt_offset') * 3600;
    $limit = get_option('pubforce_rss_limit');
    // - query -
    global $wpdb;
    $querystr = "\r\n    SELECT *\r\n    FROM {$wpdb->posts} wposts, {$wpdb->postmeta} metastart, {$wpdb->postmeta} metaend\r\n    WHERE (wposts.ID = metastart.post_id AND wposts.ID = metaend.post_id)\r\n    AND (metaend.meta_key = 'tf_events_enddate' AND metaend.meta_value > {$today6am} )\r\n    AND metastart.meta_key = 'tf_events_enddate'\r\n    AND wposts.post_type = 'tf_events'\r\n    AND wposts.post_status = 'publish'\r\n    ORDER BY metastart.meta_value ASC LIMIT {$limit}\r\n ";
    $events = $wpdb->get_results($querystr, OBJECT);
    // - loop -
    if ($events) {
        global $post;
        foreach ($events as $post) {
            setup_postdata($post);
            // - custom variables -
            $custom = get_post_custom(get_the_ID());
            $sd = $custom["tf_events_startdate"][0];
            $ed = $custom["tf_events_enddate"][0];
            // - grab gmt for start -
            $gmts = date('Y-m-d H:i:s', $sd);
            $gmts = get_gmt_from_date($gmts);
            // this function requires Y-m-d H:i:s, hence the back & forth.
            $gmts = strtotime($gmts);
            // - grab gmt for end -
            $gmte = date('Y-m-d H:i:s', $ed);
            $gmte = get_gmt_from_date($gmte);
            // this function requires Y-m-d H:i:s, hence the back & forth.
            $gmte = strtotime($gmte);
            // - Set to UTC ICAL FORMAT -
            $stime = date('Ymd\\THis\\Z', $gmts);
            $etime = date('Ymd\\THis\\Z', $gmte);
            // - item output -
            ?>
BEGIN:VEVENT
DTSTART:<?php 
            echo $stime;
            ?>
DTEND:<?php 
            echo $etime;
            ?>
SUMMARY:<?php 
            echo the_title();
            ?>
DESCRIPTION:<?php 
            the_excerpt_rss('', TRUE, '', 50);
            ?>
END:VEVENT
<?php 
        }
    } else {
    }
    ?>
END:VCALENDAR
<?php 
    // - full output -
    $tfeventsical = ob_get_contents();
    ob_end_clean();
    echo $tfeventsical;
}
Example #22
0
*/
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>roondoo | Your Personal Web-Profile <?php 
wp_title(' | ');
?>
</title>
<meta name="keywords" content="roondoo, about me, personal homepage, web profile, portfolio">
<meta name="description" content="<?php 
if (have_posts() && is_single()) {
    while (have_posts()) {
        the_post();
        the_excerpt_rss(20, 2);
    }
} else {
    ?>
Create your own free web profile at roondoo.com. Your Profile is of course Ad-Free. This is your Place on the Web.<?php 
}
?>
" />
<meta name="robots" content="index,follow">

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="http://roondoo.com/a/css/bootstrap.min.css" rel="stylesheet">
<link href="http://roondoo.com/a/css/bootstrap-responsive.min.css" rel="stylesheet">
 /**
  * Add the MRSS info to the feed
  *
  * Based upon the MRSS plugin developed by Andy Skelton
  *
  * @since     0.1
  * @copyright Andy Skelton
  */
 public function mrss_item()
 {
     global $mrss_gallery_lookup;
     $media = array();
     $lookup = array();
     // Honor the feed settings. Don't include any media that isn't in the feed.
     if (get_option('rss_use_excerpt') || !strlen(get_the_content())) {
         ob_start();
         the_excerpt_rss();
         $content = ob_get_clean();
     } else {
         // If any galleries are processed, we need to capture the attachment IDs.
         add_filter('wp_get_attachment_link', array($this, 'mrss_gallery_lookup'), 10, 5);
         $content = apply_filters('the_content', get_the_content());
         remove_filter('wp_get_attachment_link', array($this, 'mrss_gallery_lookup'), 10, 5);
         $lookup = $mrss_gallery_lookup;
         unset($mrss_gallery_lookup);
     }
     // img tags
     $images = 0;
     if (preg_match_all('`<img ([^>]+)>`', $content, $matches)) {
         foreach ($matches[1] as $attrs) {
             $item = $img = array();
             // Construct $img array from <img> attributes
             $attributes = wp_kses_hair($attrs, array('http'));
             foreach ($attributes as $attr) {
                 $img[$attr['name']] = $attr['value'];
             }
             unset($attributes);
             // Skip emoticons and images without source attribute
             if (!isset($img['src']) || isset($img['class']) && false !== strpos($img['class'], 'wp-smiley')) {
                 continue;
             }
             $img['src'] = $this->mrss_url($img['src']);
             $id = false;
             if (isset($lookup[$img['src']])) {
                 $id = $lookup[$img['src']];
             } elseif (isset($img['class']) && preg_match('`wp-image-(\\d+)`', $img['class'], $match)) {
                 $id = $match[1];
             }
             if ($id) {
                 // It's an attachment, so we will get the URLs, title, and description from functions
                 $attachment =& get_post($id);
                 $src = wp_get_attachment_image_src($id, 'full');
                 if (!empty($src[0])) {
                     $img['src'] = $src[0];
                 }
                 $thumbnail = wp_get_attachment_image_src($id, 'thumbnail');
                 if (!empty($thumbnail[0]) && $thumbnail[0] != $img['src']) {
                     $img['thumbnail'] = $thumbnail[0];
                 }
                 $title = get_the_title($id);
                 if (!empty($title)) {
                     $img['title'] = trim($title);
                 }
                 if (!empty($attachment->post_excerpt)) {
                     $img['description'] = trim($attachment->post_excerpt);
                 }
             }
             // If this is the first image in the markup, make it the post thumbnail
             if (++$images == 1) {
                 if (isset($img['thumbnail'])) {
                     $media[]['thumbnail']['attr']['url'] = $img['thumbnail'];
                 } else {
                     $media[]['thumbnail']['attr']['url'] = $img['src'];
                 }
             }
             $item['content']['attr']['url'] = $img['src'];
             $item['content']['attr']['medium'] = 'image';
             if (!empty($img['title'])) {
                 $item['content']['children']['title']['attr']['type'] = 'html';
                 $item['content']['children']['title']['children'][] = $img['title'];
             } elseif (!empty($img['alt'])) {
                 $item['content']['children']['title']['attr']['type'] = 'html';
                 $item['content']['children']['title']['children'][] = $img['alt'];
             }
             if (!empty($img['description'])) {
                 $item['content']['children']['description']['attr']['type'] = 'html';
                 $item['content']['children']['description']['children'][] = $img['description'];
             }
             if (!empty($img['thumbnail'])) {
                 $item['content']['children']['thumbnail']['attr']['url'] = $img['thumbnail'];
             }
             $media[] = $item;
         }
     }
     $media = apply_filters('mrss_media', $media);
     $this->mrss_print($media);
 }
Example #24
0
/**
 * Return XML for full feed.
 * 
 * @param   array $feed_items Array of objects. Required attributes: ID (=post id), blog_id
 * @return  string
 */
function get_feed_xml($feed_items)
{
    global $post;
    $rss_language = Settings\get_site_option('language_slug');
    if (empty($rss_language) && defined('WPLANG')) {
        $rss_language = substr(WPLANG, 0, 2);
    }
    ob_start();
    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/"
	<?php 
    do_action('rss2_ns');
    ?>
>

<channel>
	<title><?php 
    echo get_feed_title();
    ?>
</title>
	<atom:link href="<?php 
    echo get_feed_url();
    ?>
" rel="self" type="application/rss+xml" />
	<link><?php 
    echo get_feed_url();
    ?>
</link>
	<description><?php 
    echo get_feed_description();
    ?>
</description>
	<lastBuildDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), FALSE);
    ?>
</lastBuildDate>
	<language><?php 
    echo $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 
    do_action('rss2_head');
    foreach ($feed_items as $feed_item) {
        switch_to_blog($feed_item->blog_id);
        $post = get_post($feed_item->ID);
        setup_postdata($post);
        ?>
		
		<item>
			<title><?php 
        the_title_rss();
        ?>
</title>
			<link><?php 
        the_permalink_rss();
        ?>
</link>
			<comments><?php 
        comments_link_feed();
        ?>
</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('rss2');
        ?>
			
			<guid isPermaLink="false"><?php 
        the_guid();
        ?>
</guid>
	<?php 
        if (get_option('rss_use_excerpt')) {
            ?>
			<description><![CDATA[<?php 
            the_excerpt_rss();
            ?>
]]></description>
	<?php 
        } else {
            ?>
			<description><![CDATA[<?php 
            the_excerpt_rss();
            ?>
]]></description>
		<?php 
            $content = \Inpsyde\MultisiteFeed\get_the_content_feed('rss2');
            ?>
		<?php 
            if (strlen($content) > 0) {
                ?>
			<content:encoded><![CDATA[<?php 
                echo $content;
                ?>
]]></content:encoded>
		<?php 
            } else {
                ?>
			<content:encoded><![CDATA[<?php 
                the_excerpt_rss();
                ?>
]]></content:encoded>
		<?php 
            }
            ?>
	<?php 
        }
        ?>
			<wfw:commentRss><?php 
        echo esc_url(get_post_comments_feed_link(NULL, 'rss2'));
        ?>
</wfw:commentRss>
			<slash:comments><?php 
        echo get_comments_number();
        ?>
</slash:comments>
	<?php 
        rss_enclosure();
        do_action('rss2_item');
        ?>
		</item>
		
		<?php 
        restore_current_blog();
    }
    ?>
	
</channel>
</rss>
<?php 
    $xml = ob_get_contents();
    ob_end_clean();
    return $xml;
}
</author> -->
				<media:thumbnail url='<?php 
    echo esc_url($postimage);
    ?>
' height='200' width='200' />
				<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
    ?>
</pubDate>
				<content:encoded>
					<![CDATA[
					<div><?php 
    the_post_thumbnail('large');
    ?>
</div>
					<?php 
    echo '<p>' . the_excerpt_rss() . '</p>';
    ?>
					<?php 
    echo $postlink;
    ?>
					]]>
				</content:encoded>
			</item>

		<?php 
}
?>
	</channel>
</rss>
Example #26
0
		
		<?php 
if (ar2_get_theme_option('post_display[post_social]')) {
    ?>
		<div class="entry-social">
				<div class="addthis_toolbox addthis_default_style" 
					addthis:url="<?php 
    echo esc_attr(get_permalink($post->ID));
    ?>
"
					addthis:title="<?php 
    echo esc_attr(get_the_title());
    ?>
"
					addthis:description="<?php 
    the_excerpt_rss(30, 2);
    ?>
">
					<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
					<a class="addthis_button_tweet"></a>
					<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
					<a class="addthis_counter addthis_pill_style"></a>
				</div>
		</div>
		<?php 
}
?>
			
	</header><!-- .entry-header -->
    
    <div class="entry-content clearfix">
        ?>
</dc:date>
	<dc:creator><?php 
        the_author();
        ?>
 (mailto:<?php 
        the_author_email();
        ?>
)</dc:creator>
	<?php 
        the_category_rss('rdf');
        $more = 1;
        if ($rss_use_excerpt) {
            ?>
	<description><?php 
            the_excerpt_rss(get_settings('rss_excerpt_length'), 2);
            ?>
</description>
<?php 
        } else {
            // use content
            ?>
	<description><?php 
            the_content_rss('', 0, '', get_settings('rss_excerpt_length'), 2);
            ?>
</description>
<?php 
        }
        // end else use content
        ?>
	<content:encoded><![CDATA[<?php 
Example #28
0
    <?php 
// Start the loop for Podcast posts
while ($loop->have_posts()) {
    $loop->the_post();
    ?>
    <item>
      <title><?php 
    the_title_rss();
    ?>
</title>
      <itunes:author><?php 
    echo get_bloginfo('name');
    ?>
</itunes:author>
      <itunes:summary><?php 
    the_excerpt_rss(50, 0);
    ?>
</itunes:summary>
      <itunes:image href="<?php 
    echo plugins_url('assets/img/logo.jpg', dirname(__FILE__));
    ?>
" />
      
      <?php 
    // Get the file field URL and filesize
    $attachment_id = get_field('audio_file');
    $fileurl = wp_get_attachment_url($attachment_id);
    $filesize = filesize(get_attached_file($attachment_id));
    ?>
      
      <enclosure url="<?php 
Example #29
0
		<updated><?php 
    echo get_post_modified_time('Y-m-d\\TH:i:s\\Z', true);
    ?>
</updated>
		<published><?php 
    echo get_post_time('Y-m-d\\TH:i:s\\Z', true);
    ?>
</published>
		<?php 
    the_category_rss('atom');
    ?>
		<summary type="<?php 
    html_type_rss();
    ?>
"><![CDATA[<?php 
    the_excerpt_rss();
    ?>
]]></summary>
<?php 
    if (!get_option('rss_use_excerpt')) {
        ?>
		<content type="<?php 
        html_type_rss();
        ?>
" xml:base="<?php 
        the_permalink_rss();
        ?>
"><![CDATA[<?php 
        the_content_feed('atom');
        ?>
]]></content>
/**
 * head meta
 */
function classplus_headmeta()
{
    if (is_single() || is_page()) {
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
	<meta name="description" content="<?php 
                the_excerpt_rss();
                ?>
" />
	<meta name="keywords" content="<?php 
                $posttags = get_the_tags();
                if ($posttags) {
                    foreach ($posttags as $tag) {
                        echo $tag->name . ', ';
                    }
                }
                ?>
" />
	<?php 
            }
        }
    } elseif (is_home()) {
        ?>
	<meta name="description" content="<?php 
        bloginfo('description');
        ?>
" />
	<?php 
    }
    ?>
	<!-- Mobile Specific Meta -->
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<?php 
}