简体   繁体   English

如何将rss feed转换为WordPress 3.9.2的字符串

[英]How to get the rss feeds into a string for WordPress 3.9.2

I am using the feedwordpress plugin. 我正在使用feedwordpress插件。 How does one get access to all the feeds content to put it into a string php variable before output? 如何在输出之前访问所有提要内容并将其放入字符串php变量中? I figure it would be easier done by accessing the post loop for the theme(which is "twentyfourteen") but I have been messing around with it for hours and nothing changes. 我认为通过访问主题的post循环(“二十四”)会更容易完成,但是我已经花了好几个小时不停地修改它。 Or maybe thats not the post loop "wp-content\\themes\\twentyfourteen". 或者,也许那不是发布循环“ wp-content \\ themes \\ twenty-14”。 I am new to feedwordpress so still can't understand how to manipulate it from that end. 我是feedwordpress的新手,因此仍然无法理解如何从此进行操作。 I would be good to get the content into the hands of php to further filter it before output. 我希望将内容掌握在php的手中,以便在输出之前进一步过滤它。 Thanks 谢谢

It appears that the content of rss feeds have to go through either get_the_content or the_content() to post to the main area. 看来rss供稿的内容必须通过get_the_content或the_content()才能发布到主要区域。 Both of these functions are located here:wp-includes/post-template.php. 这两个功能都位于:wp-includes / post-template.php。 get_the_cotent() so look for: get_the_cotent(),所以寻找:

function get_the_content( $more_link_text = null, $strip_teaser = false ) {...

and then where it says return $output; 然后说return $output; just above the '}' you can add $myvariable = $output. 在“}”上方,您可以添加$ myvariable = $ output。

The feeds are now in $myvariable so you can do whatever you want with it. 提要现在位于$ myvariable中,因此您可以使用它进行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM