• Resolved dains

    (@dains)


    Hi, I’ve found a weird problem. I’m on WP 2.3.2, mod-rewrite enabled, .htaccess set to 666.

    When enabling pretty permalinks and using ‘ /%category%/%postname%/ ‘ , the permalinks work perfectly for tag links, both showing the pretty version and clicking through to the article display.

    However, while the category pretty-links show up ok, clicking through them results in a blank page display? The entire content section (‘ <div id=”content”></div> ‘) is completely empty, and the header is not displaying the category name either.

    The site works fine in every other respect, and returning the permalink choice to default fixes the problem.

    What I’ve tried so far:

    using index.php/%category%/%postname%/
    using just /%postname%/
    putting a category and tag base in
    all of the above in various combinations.

    I’ve searched the forums and am not finding anyone with the same problem. Can anyone help me troubleshoot what’s broken?

Viewing 15 replies - 1 through 15 (of 17 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Ummm.. What? I read your post twice, but don’t understand your problem.

    Could you provide example links so we can understand what is working and what is not working?

    Thread Starter dains

    (@dains)

    Hmm sorry, I’ll try to be more clear.

    I have a site with the regular category navigation list, and also a tag navigation list below that.

    The basic link for a category page is like https://www.homeurl.com/?cat=6. When you go into the Options/Permalink screen and enable Custom, then put in /%category%/%postname%/, it’s supposed to make your category permalinks into https://www.homeurl.com/category/subcategory, right?

    Well, it does do that- I get homeurl/category/subcategory when I mouse over the link, and when I look in the source code. And it does it for the tag links too- they become homeurl/tagname/.

    However, when I then click through a category link, I get a blank content page back. The header, sidebar and footer all display fine, but the actual content part just doesn’t return anything- the div is empty, not even the page title shows. Also, the name of the category that would normally be displayed in the document title in the header is also blank.

    The weird thing is that clicking through a tag link with the custom permalink on works fine- the articles all display perfectly, the page title is right, and the document title is right.

    Changing the permalink option away from custom to default fixes the problem immediately- everything works with the default link setup.

    So I’m assuming there’s some issue with permalinks, and I made sure that .htaccess was writeable, tried entering different things in the custom permalink field, made sure all plugins were shut off, all with no luck.

    So has anyone had this weird problem, or another problem with custom category permalinks just falling down like this?

    Thanks for any help!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Without real life examples of the problem that we can actually see, there’s nothing we can tell you. Everybody’s setup is different. Giving us fake links and telling us the problem doesn’t give us enough information to solve it.

    Give us real links to the real problem so we can see what’s really happening. Then, maybe, we can help you.

    Thread Starter dains

    (@dains)

    I’d like to, but the site is closed until launch – you’d need an admin login to view it.

    I did find a workaround, by putting archive.php into the category base field, the category links work now. It’s ugly to have /archive.php/ in the link, but hey, it makes the rest of the custom permalink work.

    So this definitely is a WordPress issue and not a theme issue. I tried several themes, including the default, and they started showing Error:404 in the content section. Guess the guy who created my “custom theme” forgot to put the failover code in ??

    Does that fix give you any ideas as to what could be wrong? I searched the forums using different terms and found a lot of people complaining about blank pages being delivered from category links, so perhaps finding the root cause of this would result in a bug report.

    As a guess, I’d say index.php has something to do with it, since it’s explicitly referenced in the .htaccess file for rewrites. For reference, my custom designed theme was built around using archive.php for “more control over the code” (whatever that was supposed to help with), so my index.php is almost blank – only has this code in it:

    <?php get_header(); ?>
    <div id=”content”></div>
    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    .

    Well, that’s all for me. Time to get moving on all of rest of the work.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    You’re confusing what the various index.php files do. Also, adding “archive.php” to the category base would have absolutely no impact on how the system works. You could add anything you like there and get the same result. WordPress Themes simply do not work that way.

    Also, you seem to be misunderstanding what the Custom permalinks do as well. The custom permalink field only applies to the single post pages, not to category or tag archives. The default for category and tag archives (once you’ve enabled pretty permalinks) is /category/cat-name and /tag/tag-name. The “category” and “tag” are literally those words. Using some other base changes the “category” and the “tag” text, nothing else.

    Now, if you are using /%category%/%postname%/ and actually have a category named “category”, then yes, you’d need to choose a different category base word.

    Thread Starter dains

    (@dains)

    Well, what can I tell you? Adding archive.php to the category base turned the category link into homeurl/archive.php/categoryname/subcategory, and that works. I had tried a different category base before, and it didn’t help.

    I have no idea why, just like I have no idea why the basic setup didn’t work with homeurl/categorybase/categoryname/subcategory, but DID work with homeurl/tagbase/tagname.

    Oh and no category is named “category”. They’re all distinct terms which are directly related to the content to help with SEO.

    My guess about the index.php file was probably wrong, but I did say it was a guess. Knowledge is what you have coming out of school, not going in ??

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Try changing the category base to just “category”. This is the default anyway. Bet it works, after you clear your browser cache and such.

    Thread Starter dains

    (@dains)

    It worked, and THAT is strange. Pretty permalinks won’t work without a specifically set category base of “category” (or “archive.php”) ??.

    But I can’t leave it blank, or use a keyword relevant to the content like “bicycles”, as it’s supposed to do.

    Does that help narrow down this problem? I’d really like it to work the way it says it should.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Dunno about that. Leaving it blank should be the same thing as having it set to “category”.

    But there’s no case where setting it to one word is any different than setting it to some other word. The word is the word, and it doesn’t make any difference what the word actually is.

    I don’t quite understand your reference to bicycles. That wouldn’t make much sense to me, unless every category you have is about bicycles… The category base is the base word for your category pages. Not a category itself.

    Anyway, from what you’re telling me, it does work exactly as it is supposed to work. I just think you’re confused on how it is supposed to work (and thus your bicycle reference). The category-name cannot come first in the URL to get a category page. It must be preceded by the category base word.

    Note that you will need to close your browser and possibly clear the browser cache after changing it to not get an error. Some browsers cache redirect information and won’t notice such changes immediately.

    Thread Starter dains

    (@dains)

    That’s correct, the entire site is about “bicycles” or “cycling” or whatever else is the best, all-encompassing keyword for the content, which is then narrowed down by the category name/subcategory name (types of bikes, types of usage, whatever ?? This creates a very good readable and SE optimized link, which is the whole point of the pretty permalink, and a major part of my content design work ??

    The admin screen is pretty clear and I did my homework, so I don’t think there’s any way I’m messing this up. It says I can use any word I want as a category base, but that doesn’t work- only explicitly declaring “category” or “archive.php” (but not index.php) works.

    Leaving the category base blank does put “category” into the url, but IT DOESN’T WORK, which confuses the heck out of me.

    The fact that the tag pages ALWAYS work, no matter what is set, is a clue that there’s something wrong on the category side, but I don’t think we’ll get any farther hacking away at the problem.

    So I’m going to accept that there’s something wrong with something somewhere, but I put /category/bicycles/ into the category base and the site works now, so I have a workaround and it’s time to move on.

    Thanks for your help troubleshooting this Otto! Way to hang in there ??

    I’m sorry but I don’t see how this is resolved. I’m having the same problem with a new install, where my permalinks are structured like so:

    https://www.myblog.com/post-title-here/

    I’ve used this structure in the past with no problems but now for some reason when I click on a category, I get a blank content page. Just like the above poster, I have my header, footer and sidebars… just nothing else.

    If you want to see exactly what I’m referring to, my new blog is here: https://tinyurl.com/2kdgr5

    It seems that WordPress will no longer accept “/.” as the category base. Now, if you actually want category pages, you have to enter a base or leave it blank to use the default.

    What can those of us who just want myblog.com/category-name/ use as the base now?

    It was never intended to work without a category base – WP needs that to function properly.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    What can those of us who just want myblog.com/category-name/ use as the base now?

    You can use an actual base word. WordPress does not, and never has, supported not having a category base word. Attempting to work without one breaks large parts of the permalink system. Always has.

    Seems to be working without a base word here: https://tinyurl.com/35e48h

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Pretty permalinks- tags work, cats don’t???’ is closed to new replies.