Title: 404 error page using the_permalink()
Last modified: August 21, 2016

---

# 404 error page using the_permalink()

 *  [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/)
 * Hi,
 * I have a huge problem with my custom post type and I have NO IDEA why it won’t
   work, since it used to work perfectly before and I didn’t really change anything
   on the code. It looks like this:
 *     ```
       <h3><?php the_title(); ?></h3>
       <?php while (have_posts()) : the_post(); ?>
       <?php the_content(); ?>
       <?php wp_link_pages(array('before' => '<nav class="pagination">', 'after' => '</nav>')); ?>
       <?php endwhile; ?>
       <?php wp_reset_query(); ?>
       ```
   
 * I have 3 of my 7 articles from my custom post type displayed on the front site
   but when I click on their links using the_permalink(), it always brings me to
   a 404 page.
 * How do I fix this?

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

 *  [greendemiurge](https://wordpress.org/support/users/greendemiurge/)
 * (@greendemiurge)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113014)
 * Basic first step when dealing with Permalink 404 issues is to go to the permalink
   settings page and set them to default, then set them back to the rewrite setting
   you are currently trying to use.
 * This especially comes up with custom post types because they have an argument
   to rewrite the taxonomy slug.
 * Give that a try to get it out of the way and post back if the problem is still
   there.
 *  Thread Starter [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113080)
 * Well, when I set the permalink settings to default, the URLs seem to work but
   it absolutely destroys the layout of my whole website. And when I change the 
   setting back to the way it was, they won’t work and still lead me to the 404 
   page.
 *  [Borko](https://wordpress.org/support/users/media-x/)
 * (@media-x)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113081)
 * What’s your custom permalink structure ? Is the custom permalink structure needed
   to make your theme work? What theme are you using?
 *  Thread Starter [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113082)
 * I use my own theme and use **post name** as permalink ([http://mysite.com/sample-post](http://mysite.com/sample-post)).
   The theme wasn’t meant to work with this permalink structure only but I would
   like to keep the same settings though.
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113083)
 * > when I set the permalink settings to default, the URLs seem to work but it 
   > absolutely destroys the layout of my whole website
 * Why? No theme should be dependant upon a given custom structure. A well-coded
   theme can handle any permalink structure.
 *  Thread Starter [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113085)
 * That’s because none of the URLs (css, JS etc.) gets loaded.
 *  [Borko](https://wordpress.org/support/users/media-x/)
 * (@media-x)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113088)
 * From the Codex:
    `Permalinks are the permanent URLs to your individual weblog
   posts, as well as categories and other lists of weblog postings. A permalink 
   is what another weblogger will use to link to your article (or section), or how
   you might send a link to your story in an e-mail message. The URL to each post
   should be permanent, and never change — hence permalink.` Permalinks are not 
   responsible for the paths pointing to CSS or JS files so i don’t get it when 
   you say:
 * > none of the URLs (css, JS etc.) gets loaded.
 * Can you post your site URL?
 *  Thread Starter [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113089)
 * Sure, it’s [http://goo.gl/5lQR44](http://goo.gl/5lQR44) but I have now reset 
   the permalink structure back to post name.
 *  [Borko](https://wordpress.org/support/users/media-x/)
 * (@media-x)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113091)
 * Please, check [this thread](http://wordpress.org/support/topic/plugin-woocommerce-woocommerce-pretty-permalinks?replies=19)
 *  Thread Starter [Raider000](https://wordpress.org/support/users/raider000/)
 * (@raider000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113118)
 * Well thanks but I don’t think that this is the right solution to my issue. I 
   even deactivated WooCommerce and it was still all the same. Even when I want 
   to view the created page from the backend, it comes up with 404. It’s just weird
   that they get loaded on the front page but not when you want to browse them single
   using the permalink.

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

The topic ‘404 error page using the_permalink()’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 4 participants
 * Last reply from: [Raider000](https://wordpress.org/support/users/raider000/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/404-error-page-using-the_permalink/#post-4113118)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
