{"id":1214,"date":"2007-06-17T15:54:46","date_gmt":"2007-06-17T12:54:46","guid":{"rendered":"http:\/\/mummila.net\/nuudelisoppa\/index.php\/?p=1214"},"modified":"2007-06-17T15:54:46","modified_gmt":"2007-06-17T12:54:46","slug":"wandering-through-wordpress-weirdness","status":"publish","type":"post","link":"https:\/\/mummila.net\/nuudelisoppa\/2007\/06\/17\/wandering-through-wordpress-weirdness\/","title":{"rendered":"Wandering through WordPress weirdness"},"content":{"rendered":"<p>I&#8217;ve been hacking <a href=\"http:\/\/www.fyreplace.com\/simpletagsplus\">SimpleTagsPlus<\/a> into not displaying the embedded tags when the content is called via <code>the_content_rss<\/code>. I wanted it to do so because I&#8217;m using <code>the_content_rss<\/code> in my theme for publishing excerpts (in <a href=\"http:\/\/mummila.net\/marginaali\/\">my other blog<\/a>), and that makes those embedded SimpleTags look ugly. That&#8217;s because they&#8217;re not rendered, which in turn is due to the fact that SimpleTagsPlus functions are applied only to <code>the_content<\/code> and not to <code>the_content_rss<\/code>.<\/p>\n<p>I was able to fix this by adding, to <code>the_content_rss<\/code>, a filter of my own for skipping the tags altogether (i.e. replacing any occurences of <code>[tags]...[\/tags]<\/code> with an empty string). But while doing this I came across some interesting issues&#8230;<\/p>\n<p>First off, there&#8217;s this funny little bug #3884 in WordPress&#8217; bug tracker:<\/p>\n<blockquote><p><q>Plugins using the filter <q><code>the_content_rss<\/code><\/q> are never applied in the RSS2 and Atom feeds, and still not working in the  tag of the RDF feed.<\/q><\/p>\n<p><a href=\"http:\/\/trac.wordpress.org\/ticket\/3884\" class=\"source\">WordPress trac<\/a><\/p><\/blockquote>\n<p>While reading about it I came to think that my feeds must have been displaying those ugly <code>[tags]...[\/tags]<\/code> blobs as part of their content. And now, because of #3884, it seems that I can&#8217;t fix it in feeds other than the plain RSS one.<\/p>\n<p>But it turns out to be more complex than that. Instead of full posts, I&#8217;ve been providing my feed readers only with summaries for some time now (can&#8217;t remember when or why I made the switch), and thanks to that, the embedded tags are not displayed in the feeds.<\/p>\n<p>Apparently, the question of <a href=\"http:\/\/www.businessandblogging.com\/2007\/04\/23\/why-more-can-be-less-in-a-wordpress-feed\/\">summaries vs. full posts in feeds<\/a> is a rather heated one, and I honestly can&#8217;t say my choice to provide only the summaries has been a heavily deliberated one. But now, because of the issue I had thought <em>already<\/em> plagued my feeds, I&#8217;m not sure I would even <em>want<\/em> to make the switch back to full text feeds even if I otherwise did: the full text posts in my feeds would then contain those unrendered embedded tags right at the beginning where I&#8217;ve chosen to place them.<\/p>\n<p>By using a heavier solution to tagging, such as <a href=\"http:\/\/www.neato.co.nz\/ultimate-tag-warrior\">Ultimate Tag Warrior<\/a>, from the beginning I would have avoided this, since (<abbr title=\"As Far As I Know\">AFAIK<\/abbr>) <abbr title=\"Ultimate Tag Warrior\">UTW<\/abbr> does not make tags part of the posts themselves like <abbr title=\"SimpleTagsPlus\">STP<\/abbr> does, thus eliminating them from the feeds &#8212; just the way I&#8217;d want it to be. But back when I was considering the alternatives, UTW seemed somewhat of an overkill. Obviously, I wasn&#8217;t thinking far enough ahead or big enough.<\/p>\n<p>I found a WordPress.org support forum thread discussing the possibility of providing readers with <a href=\"http:\/\/wordpress.org\/support\/topic\/34807\"><em>both<\/em> the summary feed <em>and<\/em> the full text feed<\/a> (<a href=\"http:\/\/www.stevepavlina.com\/blog\/2005\/07\/full-text-feeds-restored\/#comment-6454\">via <b>Oliver<\/b>@StevePavlina.com<\/a>), and I think I&#8217;m gonna try and implement the solution suggested there. And then I&#8217;m gonna have a serious look at replacing SimpleTagsPlus with Ultimate Tag Warrior. A a bonus, that would allow me to <a href=\"http:\/\/www.maunderlust.com\/wordpress-upgrade-taggd\/#comment-258\">display a nice-looking tag cloud<\/a> on my archives page, something which apparently can&#8217;t be done with SimpleTagsPlus.<\/p>\n<p><ins datetime=\"2007-06-17T15:57:13+00:00\">Added 18:57<\/ins>: The one feed that displays full summaries, when the option is selected, is the RSS2 feed, and while tweaking the files I found that it calls <code>the_content<\/code> and <strong>not<\/strong> <code>the_content_rss<\/code> for producing the content, so it will be properly formatted by SimpleTagsPlus after all, eliminating any problems when switching back to full text feeds. Since I had already figured out how to publish both the summaries and the full text feeds, I just reversed the procedure by making full text posts in feeds the default and publishing an additional summaries-only feed with the hack described in the aforementioned WP forums link.<\/p>\n<p><ins datetime=\"2007-06-17T16:03:54+00:00\">Added 20:27<\/ins>: I came across some very bizarre behavior from WordPress after having set up my summaries feeds. The feeds were seemingly ok in the browser, but Google Reader wouldn&#8217;t load them and <a href=\"http:\/\/feedvalidator.org\/\">Feed Validator<\/a> claimed there was a 404 error fetching them &#8212; yet it would display their source right after the error! At first I couldn&#8217;t even find anything resembling this, and when I did (examples <a href=\"http:\/\/forum.dreamhosters.com\/troubleshooting\/41103-RewriteRule-content-ok-but-404-returned-in-HTTP.htm\">1<\/a>, <a href=\"http:\/\/wordpress.org\/support\/topic\/24280\">2<\/a>, <a href=\"http:\/\/wordpress.org\/support\/topic\/23522\">3<\/a>, <a href=\"http:\/\/wordpress.org\/support\/topic\/122042\">5<\/a>) the links had no solutions or the <a href=\"http:\/\/wordpress.org\/support\/topic\/24280#post-137052\">solutions were referred to<\/a> but the <a href=\"http:\/\/mosquito.wordpress.org\/view.php?id=903\">links were dead<\/a>, or <a href=\"http:\/\/wordpress.org\/support\/topic\/23522\/page\/2#post-174027\">the solution was more than two years old<\/a> and couldn&#8217;t be applied to newer WordPress versions.<\/p>\n<p>Finally, I found a bug posted on wp-trac, describing a similar-sounding situation with a little hackish but functioning workaround. Apparently, forceably rewriting the headers to report 200 instead of 404 does the trick, like so:<\/p>\n<blockquote>\n<pre><code>header(\"HTTP\/1.1 200 OK\");<br \/>\nheader(\"Status: 200 All rosy\") ;<\/code><\/pre>\n<p><a href=\"http:\/\/trac.wordpress.org\/ticket\/2984\">WordPress trac<\/a><\/p><\/blockquote>\n<p>I inserted these lines into my <code>feed-(rss|rss2|atom)-summaries.php<\/code> files, between the <code>header('Content-type...<\/code> and <code>$more = 1;<\/code> lines, and voil\u00e0! No more 404 from Feed Validator.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been hacking SimpleTagsPlus into not displaying the embedded tags when the content is called via the_content_rss. I wanted it to do so because I&#8217;m using the_content_rss in my theme for publishing excerpts (in my other blog), and that makes those embedded SimpleTags look ugly. That&#8217;s because they&#8217;re not rendered, which in turn is due [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[9387,26],"class_list":["post-1214","post","type-post","status-publish","format-standard","hentry","tag-blog","tag-open-source"],"_links":{"self":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1214","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/comments?post=1214"}],"version-history":[{"count":0,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/posts\/1214\/revisions"}],"wp:attachment":[{"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/media?parent=1214"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/categories?post=1214"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mummila.net\/nuudelisoppa\/wp-json\/wp\/v2\/tags?post=1214"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}