Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Art4orm

    (@art4orm)

    Thanks for the response Otto. For some reason when I use the “Publish to Your Facebook Profile” button, it loads up the description but no featured image.

    I only have the following parts of the plugin package activated.
    SFC – Publish
    SFC – Share Button
    Simple Facebook Connect – Base

    Any ideas?

    I did find one flaw in the above script – you get a 404 when looking for sub-categories (ex: http://www.domain.com/cat1/cat2/). If you load the post directly (ex: http://www.domain.com/cat1/cat2/post) it will come up, but sub-categories won’t list out.

    All of my sites are running the No Category Base plugin and this issue has been something that has plagued me since upgrading to version 3.1. The following test was done using wordpress 3.1.1.

    By default, worpdress has always placed the “category” priority over “page” priority – even in earlier versions. To test this theory, try creating a page title the same as what you setup your permalink category base to (or set the page title to category if your permalink category base is blank); The page doesn’t auto load UNTIL you activate the No Category Base Plugin.

    I found a simple function script that removes category from the URL structure and still places the “category” priority over “page”.

    add_filter('user_trailingslashit', 'remcat_function');
    function remcat_function($link) {
        return str_replace("/category/", "/", $link);
    }
    
    add_action('init', 'remcat_flush_rules');
    function remcat_flush_rules() {
        global $wp_rewrite;
        $wp_rewrite->flush_rules();
    }
    
    add_filter('generate_rewrite_rules', 'remcat_rewrite');
    function remcat_rewrite($wp_rewrite) {
        $new_rules = array('(.+)/page/(.+)/?' => 'index.php?category_name='.$wp_rewrite->preg_index(1).'&paged='.$wp_rewrite->preg_index(2));
        $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
    }

    Is it the order by which this script flushes the rewrite and reestablishes the rules that makes it work?

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