• Hello,

    I have a custom theme which allows me to set up properties and using a template within the theme, it takes all those properties and puts them on one page. Now I am trying to have it send the types of property to 2 different pages, one for sale and the other sold. I have set up Post Types and Categories. I have made pages just for the categories and custom post types. All I get is 404. Any help would be appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • After you create Custom Post Type, you need to visit Permalinks settings just one time to refresh the URL setup there. It might resolve your 404 issue.

    I mean go to WP-Dashboard > Settings > Permalinks

    Just visiting that page will refresh the URL rules.
    Check if 404 is gone? If not then you might have some other issues but most common scenario in this situations is what I shared above.

    Moderator bcworkz

    (@bcworkz)

    “other issues” to say the least! ??
    There lots of possible issues. Let’s start with what URLs do you want to use to get to these two different pages? What form these take will dictate what approach you should use. Separate pages may not be the best approach.

    Thread Starter technodestructo

    (@technodestructo)

    Hey Folks,

    Thanks for the responses. I already did the permalinks thing, no dice. So I did some more digging into the problem. The 404 page being generated wasn’t “real” if that makes sense. There is a logical error somewhere in the index.php file for the theme that won’t allow the CPT to be redirected to where I want.

    Thread Starter technodestructo

    (@technodestructo)

    Follow up to @bcworkz,

    I agree, the two page approach is not the way I think we should go, at all. There are much, much simpler ways to solve this. However, I am a freelance web developer and the client is DEMANDING this two page method.

    Moderator bcworkz

    (@bcworkz)

    Are you getting a true server 404 file not found? If so there’s a problem with your .htaccess file (assuming Apache server). Perhaps it’s not writable to the WP system? A “real” 404 I suppose, so no.

    Or a ‘soft’ page not found styled by your theme? Then there is an issue with the permalinks you are trying to use and/or the resulting query isn’t finding any posts. Examine the resulting query by hooking the ‘posts_request’ filter and echoing out the passed query string. There will be something in the query that is contradictory, assuming there is an actual page that should be returned.

    One part of the query should be WHERE 1=1. If you see 1=0, then of course the query will always fail. This means there was an error parsing the permalink and the parser signifies an error with the 1=0. If you see 1=1 there still would be contradictory terms somewhere in the query string.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Post Types and Categories’ is closed to new replies.