WordPress.org

Support

Support » Plugins and Hacks » "uncategorized" generated in url, breaking the link to the post"

"uncategorized" generated in url, breaking the link to the post"

Viewing 1 replies (of 1 total)
  • Plugin Author Jose Luis SAYAGO

    @iluminatus

    Hello Marty,

    I think this problem is due to the change of themes, have you tried to refresh the permalink structure? Settings > Permalinks

    It seems your new theme uses a different permalink structure, using post types instead of categories, this may be causing the wrong behavior. Permalinks are stored into the database, when pulling them through the plugin, links pointing to the previous permalink structure are retrieved.

    Your current structure is pointing to: %category%/%postname% when it should be pointing to: property/%postname% in case your blog will only serve information through the ‘property’ post type.

    Another possible solution is to use jQuery to replace categories by post types, in this case something like:

    jQuery(document).ready(function() {
          jQuery(".nlposts-block-thumbnail a").each(function() {
               this.setAttribute("href", this.getAttribute("href").replace(/\uncategorized/, "property"));
          });
    };

    Put the code into a file called nlp-links.js, then save it into your active WordPress theme folder (from the blog you’re using Network Latest Posts), next open the functions.php file located inside the same folder and add these lines to the end, right before the php closing tag ?>:

    function nlp_load_links() {
          wp_enqueue_script('nlp-links',get_stylesheet_directory_uri().'nlp-links.js');
    }
    add_action('wp_enqueue_scripts', 'nlp_load_links');

    The script will replace all ‘uncategorized’ (categories) by ‘property’ (custom post type), you can see the code working here: http://jsfiddle.net/6nKfW/

    Let me know if you need more help.

    Kind regards,
    José Luis

Viewing 1 replies (of 1 total)
  • The topic ‘"uncategorized" generated in url, breaking the link to the post"’ is closed to new replies.