Network Latest Posts
"uncategorized" generated in url, breaking the link to the post" (2 posts)

  1. martypao
    Posted 3 years ago #

    My website provides virtual tours or image slideshows for Realtors. I use Network Latest Posts to advertise the most recent virtual tours in a sidebar using the N.L.P. plugin widget.

    It has been fine until now. Instead of coding a new virtual tour template for wp3.5, I purchased a theme "Freehold" that I am now using for the virtual tour.

    Here is the link that shows:
    Here is what I need to show:

    Note: The virtual tour is a Custom Post Type of "property". The widget displays the custom post type properly. But generated link will take you to a 404 page.

    Also note: No matter what is set in permalinks, the only way that the virtual tour post will display is for the url string to be:
    1.website / 2. the taxonomy "property" / 3. the virtual tour post slug.

    Any help would be appreciated. Thanks.

    Marty Paoletta
    ProMedia Tours


  2. Jose Luis SAYAGO
    Plugin Author

    Posted 3 years ago #

    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() {
    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Network Latest Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic