Mike Lee
Forum Replies Created
-
Thanks! If at all possible, I would love to see this in the next release 😉
In any case, I’ll mark this topic as resolved.
Yup, correct.
in_array($cat->parent, $exclude_categories)checks to see if the category’s parent is listed in the exclude_categories array.This wouldn’t go any higher up the category hierarchy though. For instance, if someone had 3 or more levels of child categories, doing this would only climb up one level.
If you would like to offer the ability to exclude an entire parent category and all of its children, you could look into using the custom
post_is_in_descendant_categoryfunction listed in the WP Codex:
http://codex.wordpress.org/Function_Reference/in_category#Testing_if_a_post_is_in_a_descendant_categoryAnd thanks for putting out such a great plugin too!
FYI, here is a simple change that does offer this functionality, though I really don’t want to be modifying this plugin’s code since it will cause update problems. But in case someone else has this problem, or the plugin author is reading this and is interested in suggestions, here is an option:
In file top-10.php, line 408, change it from:
$p_in_c = (in_array($cat->cat_ID, $exclude_categories)) ? true : false;to:
$p_in_c = (in_array($cat->cat_ID, $exclude_categories) || in_array($cat->parent, $exclude_categories)) ? true : false;Hi dlkoro,
Sorry for the long delay in reply. We are working on a way that will allow you to easily translate the text in this widget.
For now, if you’re in a dire rush for translations and know WordPress & PHP, you can dig into the code behind the plugin to translate the text yourself, as some users have done. Here’s one in Spanish:
http://vosquedecis.com.ar/2011/12/que-metodo-anticonceptivo-utilizas/The downside of modifying the plugin’s internal code yourself is when we update the plugin, the update will overwrite your modifications. The ability to do translations is high on our priority list though, so one of the coming versions will have this.
I hope this helps. Thanks!
Forum: Fixing WordPress
In reply to: 404 Not Working ProperlyJust in case this helps someone here, the cause of this problem for me was using FastCGI. A fix has been documented here.
Forum: Fixing WordPress
In reply to: WordPress Steals 404Just in case this helps someone here, the cause of this problem for me was using FastCGI. A fix has been documented here.
Forum: Fixing WordPress
In reply to: Problem with 404 and .htaccessJust in case this helps someone here, the cause of this problem for me was using FastCGI. A fix has been documented here.
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorSolved!
My sysadmin looked into the problem, did some research, and discovered that FastCGI was causing the problem.
The solution has already been documented here on this forum, in the thread problems running under php/fastcgi.
Big thanks to everyone here who helped out! And much thanks to my brilliant sysadmin!
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorAh, thanks for the info, phord.
So the prevailing assumption is that this may be caused by a particular Apache configuration set by my host, which is not playing nice with my WordPress installation. I’ll send a note to my hosting provider to see if they have any insights.
Forum: Fixing WordPress
In reply to: Problem with 404 and .htaccessI don’t have an answer yet, but I’ve been trying to debug the same problem. I’ve been documenting my steps at this thread.
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorInteresting. I wonder what it is that my host has doing that’s different than your host.
So I compared the response headers from my server to your server, and here’s what I found:
Mine:
404 OKYours:
404 Not FoundAnother user just posted this thread a few hours ago with the same issue. I looked at his response headers and saw this:
404 OKTo do one more comparison, I went to http://wordpress.org/404 to throw a 404 error on this machine. Also received a:
404 Not FoundI see a bit of a pattern here. Seems that my server isn’t throwing a correct 404 header. That would explain why an
ErrorDocument 404isn’t working.And furthermore, this is only the case when I have these rules in my .htaccess file:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
When I remove these rules, my 404 header works as it should.
So why are these rules causing my 404 header to foul up? Hmmm…
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorBugs Have Been Filed
It appears that several bugs have already been filed on this issue.
Ticket #2651 (reopened): 404.php not implemented with different permalink structure – filed by sluggo on April 9th, 2006
Ticket #2376: Custom 404 page error/conflict with permalinks – filed by vsa on Feb. 2nd, 2006
Hopefully a resolution will come out of these soon. In the meantime, I’ll keep digging away at the code. And if you have any insights, I’d greatly appreciate them! Thanks!
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorSteps I’ve Taken So Far
- First, I read all of the documentation on Creating an Error 404 Page and Using Permalinks, trying all of their suggestions. None of them worked for me.
- Next, I took a look at my .htaccess file. It’s CHMOD access was 666 (which is correct, and what an omen, huh?). The contents of it were:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
ErrorDocument 404 /404.html
This is what WordPress created for the custom permalinks, and it appears to be working as it should – except for the last line. The last line should be displaying the custom 404.php file. And for some reason, it wasn’t.
- Next, I verified that my hosting provider has the Apache module mod_rewrite installed. They do.
- Next, I read all of the above forum threads and even tried a search on Yahoo and Google. The thread WP 2.0 messed up my permalinks held some promise. One of our members, Ryan, posted some fixes to the functions-post.php and classes.php files. I promptly downloaded & installed them. Unfortunately, they didn’t resolve the bug.
- Then I turned off my custom permalinks and found my custom 404 page working as it should. However, when I tried to point my 404 page to the custom one in my theme (using:
ErrorDocument 404 /index.php?error=404in my .htaccess file), I received the same error again. Hmmm. - Then I decided to dig into the .htaccess file some more, to understand exactly what it was doing. I read up on this Apache module mod_rewrite documentation. And here is what I understand to be going on:
This turns on the mod_rewrite runtime engine:
RewriteEngine OnThis sets the base URL for rewrites to my document root URL (for you, it could be different):
RewriteBase /This sets a condition to detect whether or not the URL to your blog is a valid filename. If it’s NOT, then it returns true:
RewriteCond %{REQUEST_FILENAME} !-fThis sets a condition to detect whether or not the URL to your blog is a valid directory. If it’s NOT, then it returns true:
RewriteCond %{REQUEST_FILENAME} !-dIf both conditions are true (meaning if the URL to your blog is not an existing filename or directory, then go to your root index.php file:
RewriteRule . /index.phpAh ha. That seems to be something. So essentially, these rewrite conditions are hijacking the errorDocument statement and pushing every request through index.php. That explains why my system has been seemingly ignoring my errorDocument statement.
- Then I typed in this explicitly:
blog_domain_name.com/index.php?error=404, since that’s what this documentation suggests. Instead of seeing my custom 404 page, I get my blog’s homepage. Ah. Now I think I’m getting closer to the problem. The issue seems to be in how WordPress handles theerrorquerystring parameter. - Now I’m going to dig into WordPress’ code to find out exactly what it does with the
errorparameter. It seems to me thatblog_domain_name.com/index.php?error=404should work, and for some reason, it isn’t. Give me a few days to look into this. If I find any answers, I’ll post them right away. If you have any comments, please post them to this thread! Thanks!
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorRelated Threads:
WP 2.0 messed up my permalinks
Next, I’ll go into the steps I’ve taken so far to try to debug this issue.
Forum: Fixing WordPress
In reply to: Custom permalink and 404.php errorMy System’s Set-up:
FreeBSD 5.4
Apache 1.3.34
PHP 4.4.2
WordPress 2.0Next, I’ll point to several related threads in this forum.