WordPress.org

Ready to get started?Download WordPress

Forums

Permalink issue (4 posts)

  1. mabarroso
    Member
    Posted 9 years ago #

    Permalink /%category%/%year%/%monthnum%/%day%/%postname%/ fails. To fix the problem edit file wp-includes/template-functions-category.php and replace:

    ---begin code---
    function get_the_category($id = false) {
    global $post, $wpdb, $category_cache;

    if (! $id) {
    $id = $post->ID;
    }

    if ($category_cache[$id]) {
    $categories = $category_cache[$id];
    } else {
    $categories = $wpdb->get_results("
    SELECT category_id, cat_name, category_nicename, category_description, category_parent
    FROM $wpdb->categories, $wpdb->post2cat
    WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$id'
    ");

    }

    if (!empty($categories))
    sort($categories);

    return $categories;
    }
    ---end code---

    for

    ---begin code---
    function get_the_category($id = false) {
    global $post, $wpdb, $category_cache;

    if (! $id) {
    $id = $post->ID;
    }

    if ($category_cache[$id] && ($category_cache[$id]->category_nicename)) {
    $categories = $category_cache[$id];
    } else {
    $category_cache[$id] = $wpdb->get_results("
    SELECT category_id, cat_name, category_nicename, category_description, category_parent
    FROM $wpdb->categories, $wpdb->post2cat
    WHERE $wpdb->post2cat.category_id = cat_ID AND $wpdb->post2cat.post_id = '$id'
    ");
    $categories = $category_cache[$id];
    }

    if (!empty($categories))
    sort($categories);

    return $categories;
    }
    ---end code---

    Sample in http://juglardegamusinos.mordedor.com

  2. James
    Happiness Engineer
    Posted 9 years ago #

  3. mabarroso
    Member
    Posted 9 years ago #

    Submitted, thanks

  4. James
    Happiness Engineer
    Posted 9 years ago #

    No, thank you. ^_-

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.