alanft
Forum Replies Created
-
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Admin only?there’s an admin-only suggestion on
http://wordpress.org/extend/plugins/widget-logic/other_notes/
Forum: Plugins
In reply to: [Plugin: Widget Logic] – anyone figure the logic to do this…?yr real close there. the end point is to return true or false. and WL does what’s meant to be a nice thing, but might confuse this, which is:
If there is no ‘return’ in the text, an implicit ‘return’ is added to the start and a ‘;’ is added on the end.
So you need to add some explicit ‘return’s otherwise your code will end up starting ‘return global $post;’ which will not evaluate ‘true’ (I think).
So first trick (looking at your requirements in the top post is “only shows if the item belongs to a single category only”, which would translate as
if( count( $cats ) > 1 ) return false;then after that you can check for your is/in_category stuff. Making:
global $post; $cats = wp_get_object_terms( $post->ID, 'category' ); if( count( $cats ) > 1 ) return false; return ( is_category( 26 ) || is_single() && in_category( 26 ) );phew. let me know how that works out for you.
Forum: Plugins
In reply to: [Widget Logic] WIdget Logic stopped working when inserting conditionalstry simply ‘true’ and ‘false’, then if they work (true shows the widget, false hides it), there is something up with the coding. Another thing to try is the wp_reset_query option.
Forum: Plugins
In reply to: [Plugin: Widget Logic] – anyone figure the logic to do this…?you could use
wp_get_object_terms($post->ID, 'category');which gets you an array of all categories. That way you could test the number of categories a post is in. Remember to use global $post in widget logic.
Forum: Plugins
In reply to: [Widget Logic] After Activating the plugin, my site crashed…!I think what’s happening is some widget is not behaving as expected. I have a suggested fix for you, but it would be useful to know what widget making plugins you are both using too.
after line 150 “$id=array_pop($params);”, insert this extra line:
if (!is_string($id)) return;which I think will have the effect of always hiding problematic widgets. Let me know how that works out for you.
Forum: Plugins
In reply to: [Widget Logic] is_home tag not working in right sidebar.have you checked the faq yet?
http://wordpress.org/extend/plugins/widget-logic/faq/
especially the link to the main page/front page link
Forum: Plugins
In reply to: [Widget Logic] After Activating the plugin, my site crashed…!can you confirm the version you are using (and if it’s not the latest, please update and let me know what happens)
is_page is certainly meant to work that way ok with array of page IDs:
http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page
I don’t know what to suggest to fix your problem, sorry.
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] error noticesv 0.48 came out last week – contrary to what ‘Last updated’ says on the WP page, you can see the spike in downloads starting a week ago. This version was a minor update that was meant to put an end to problems thrown out with wp_debug enabled.
More specifics of your issues would be welcome.
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] error noticesIs that with the latest version? The recent update was meant to stop these notices
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Disabled for anonymous usersIt might be over-zealous server side caching that needs refreshing?
yes, it works as described here:
http://codex.wordpress.org/Conditional_Tags#A_Tag_Page
if your tag does have that slug, then it could be curly quotes, or it could be something local to your theme’s code that’s messing up the evaluation of is_tag
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Disabled for anonymous usersthis is not the case. widget logic, if active, can hide widgets regardless of the logged in status of the viewer/client.
the logic itself may be written to depend on it, or not, too.
Because every URL you look at will be either true for
!is_single(‘podcast-9’)
OR
!is_page(‘events’)
When on the podcast-9 post/page, it’s True that it’s not the events page and vice versa
http://codex.wordpress.org/Conditional_Tags#Any_Archive_Page
is_archive()
When any type of Archive page is being displayed. Category, Tag, Author and Date based pages are all types of Archives.so if you want to filter out particular archive pages you can do eg:
is_archive() && !is_tag()