<?xml version="1.0" encoding="UTF-8"?>
<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>理想盒子 &#187; 调用</title>
	<atom:link href="http://www.99is.com/website/archives/tag/%e8%b0%83%e7%94%a8/feed" rel="self" type="application/rss+xml" />
	<link>http://www.99is.com</link>
	<description>这些年，我乱写的那些文字...</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:20:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>wordpress标题截取字符方法</title>
		<link>http://www.99is.com/website/archives/247.html</link>
		<comments>http://www.99is.com/website/archives/247.html#comments</comments>
		<pubDate>Mon, 01 Mar 2010 07:42:50 +0000</pubDate>
		<dc:creator>thewei</dc:creator>
				<category><![CDATA[建站之之]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[分类文章]]></category>
		<category><![CDATA[标题]]></category>
		<category><![CDATA[调用]]></category>

		<guid isPermaLink="false">http://www.99is.com/?p=247</guid>
		<description><![CDATA[今天想用wordpresss调用某分类下的十篇文章，但是调用出来的文章标题长度如果多就会换行，如果用CSS来控制的话，可以用overflow:hidden来控制，但我又想在标题后面出现省略号，于是找到下面的方法实现。 加入在functions.php里面： &#60;?php function TruncateTitle($max_length) { $title_str = get_the_title(); if (mb_strlen($title_str,&#8217;utf-8&#8242;) &#62; $max_length ) { $title_str = mb_substr($title_str,0,$max_length,&#8217;utf-8&#8242;).&#8217;&#8230;&#8217;; } return $title_str; } ?&#62; 调用方法： &#60;a href=&#8221;&#60;?php the_permalink() ?&#62;&#8221; rel=&#8221;bookmark&#8221; class=&#8221;title&#8221;&#62;&#60;?php echo TruncateTitle(17); ?&#62;&#60;/a&#62; 17为标题的长度. 下面是调用分类ID为3，文章数为10的代码： &#60;?php query_posts(&#8216;showposts=10&#38;cat=3&#8242;); ?&#62; &#60;?php while (have_posts()) : the_post(); ?&#62; &#60;li&#62;&#60;a href=&#8221;&#60;?php the_permalink() ?&#62;&#8221; rel=&#8221;bookmark&#8221;&#62;&#60;?php echo TruncateTitle(17); ?&#62;&#60;/a&#62;&#60;/li&#62; &#60;?php endwhile; ?&#62;<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F436.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">强大的wordpress呀</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F36.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress主题：Dreambox V1 ver.1.5发布(update:2010/1/26)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F450.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress的4种更改新域名的设置方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F438.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">让wordpress不同页面显示不同数量的文章</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天想用wordpresss调用某分类下的十篇文章，但是调用出来的文章标题长度如果多就会换行，如果用CSS来控制的话，可以用overflow:hidden来控制，但我又想在标题后面出现省略号，于是找到下面的方法实现。<br />
加入在functions.php里面：</p>
<blockquote><p>&lt;?php</p>
<p>function TruncateTitle($max_length) {</p>
<p>$title_str = get_the_title();</p>
<p>if (mb_strlen($title_str,&#8217;utf-8&#8242;) &gt; $max_length ) {</p>
<p>$title_str = mb_substr($title_str,0,$max_length,&#8217;utf-8&#8242;).&#8217;&#8230;&#8217;;</p>
<p>}</p>
<p>return $title_str;</p>
<p>}</p>
<p>?&gt;</p></blockquote>
<p>调用方法：<br />
<span id="more-247"></span></p>
<blockquote><p>&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; class=&#8221;title&#8221;&gt;&lt;?php echo TruncateTitle(17); ?&gt;&lt;/a&gt;</p></blockquote>
<p>17为标题的长度.</p>
<p>下面是调用分类ID为3，文章数为10的代码：</p>
<blockquote>
<div id="_mcePaste">&lt;?php query_posts(&#8216;showposts=10&amp;cat=3&#8242;); ?&gt;</div>
<div id="_mcePaste">&lt;?php while (have_posts()) : the_post(); ?&gt;</div>
<div id="_mcePaste">&lt;li&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221;&gt;&lt;?php echo TruncateTitle(17); ?&gt;&lt;/a&gt;&lt;/li&gt;</div>
<div id="_mcePaste">&lt;?php endwhile; ?&gt;</div>
</blockquote>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F436.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">强大的wordpress呀</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F36.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress主题：Dreambox V1 ver.1.5发布(update:2010/1/26)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F450.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">WordPress的4种更改新域名的设置方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F438.html&from=http%3A%2F%2Fwww.99is.com%2Fwebsite%2Farchives%2F247.html">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">让wordpress不同页面显示不同数量的文章</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.99is.com/website/archives/247.html/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

