Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • At everyone who tried using my hack, what does your permalink structure look like?

    fongandrew

    (@fongandrew)

    Figured out a quick fix. This works in WP 3.1.

    In wp-includes/canonical.php, find this line:

    } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks()) {

    Change it to this:

    } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && ! (count($_GET) == 2 && !empty($_GET['cat']) && !empty($_GET['m']))) {

    Explanation: The category archive plugin creates links to URLs like this: https://www.myblog.com?cat=5&m=200910 (this means, show me all posts in category 5 for Oct. 2009). When permalinks are on, the above conditional sends us into code that retries to rewrite the query in a “prettier” format.

    The changed conditional says that if the requested URL looks like a category archive URL, don’t try to rewrite the query. That means your category archive URLs will be “ugly” but at least they work. And permalinks for regular posts will still be correct.

    Using 3.0.1 and it’s still not working. Without changing any code, the query ?m=2010&cat=4 redirects to the archive page for category 4 (but not any specific month or year).

    Using the change Hugh suggested, the query ?m=2010&cat=4 redirects to the archive page for the year 2010 (but shows all categories).

    This only applies when using the non-default permalink structure of course.

    Ideas?

    Referring to Otto’s earlier fix, here is full code from wp-rss2.php (actually in wp-includes/feed-rss2.php for me)

    <?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_content() ?>]]></content:encoded>
    	<?php endif; ?>
    <?php endif; ?>

    As Otto just said, the description tag is always supposed to be a summary so that’s not a problem. The content should be in content:encoded, which is written if get_option(‘rss_use_excerpt’)) returns false. If you look at the actual feed source, for some reason, there’s no content:encoded, indicating that get_option(‘rss_use_excerpt’)) is returning true when it shouldn’t.

    An easy fix, if you don’t mind not having the option of using excerpts, is to simply get rid of the excerpt check.

    So just replace above code with this

    <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_content() ?>]]></content:encoded>
    	<?php endif; ?>

    `

Viewing 4 replies - 1 through 4 (of 4 total)