alanft
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Widget Logic] Help with conditional statementyou need to bracket together
(is_single() && in_category(‘7’))
Forum: Plugins
In reply to: Widget Logic Helpyou need
global $post;
at the beginning
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Strange behaviour of new implementationI have been very bad at getting round to what I promised in this thread
http://wordpress.org/support/topic/plugin-widget-logic-wordpress-fatal-error
which is to say a ‘delayed’ loading of WL. The new ‘sidebars_widgets’ filter approach means that the sidebar is evaluated a number of times depending on themes and plugins used – often to check if there are no widgets, in which case a theme can provide alternative content or layout markup.
What i said in that thread is that I’ll work on providing the option of when WL steps in to intercept widgets – because some people do want it early, but others like yourself (probablt even the majority) would benefit from/prefer it later. I’m thinking of offering:
plugins_loaded (the current default)
after_setup_theme (so theme functions will be callable)
wp_loaded (another crucial point where all code is ready to go)
wp_head (after the query is run and posts to display are selected)This last would introduce ‘compatibility’ with the old version, and would suit you I think. One problem users had in the old version (and it’s in the FAQ) was that some themes forgot to call wp_head, so I thought I was being clever not having to resort to it. But at least with these alternatives, WL should be able to cope with a wider range of needs.
I’ll try to get something in the next couple of weeks.
Forum: Plugins
In reply to: [Display Widgets] [Plugin: Display Widgets] Will the code still be processed?You would not get the mail if you put ‘false’ in such a widget’s widget logic field
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Formatting suggestionThanks. If you try the ‘development version’ you’ll find I’ve made the input area a text area with that very class 🙂
the error implies there is at least one error in at least one of the widget logic fields on that site. check all the code for missing brackets etc.
You can try blanking out the widget logic in each widget in turn to track down the problem
is_page works fine, but take care of the issue mentioned on
http://codex.wordpress.org/Function_Reference/is_page#Cannot_Be_Used_Inside_The_Loop
re cannot be used inside (or after) the Loop. if your theme calls the sidebar after the loop, you will have this problem. try the ‘wp_reset_query fix’ option at the foot of the widget options page
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Is is_page_template() tag supported?I concur with what JochenT says. is_page and is_page_template work as well as they do in general – i.e. take note of the issue mentioned on
http://codex.wordpress.org/Function_Reference/is_page_template
re ‘Cannot Be Used Inside The Loop’. so if your sidebar is called AFTER the loop, you might find the ‘wp_reset_query’ fix helps you out
Forum: Plugins
In reply to: [Display Widgets] [Plugin: Display Widgets] Will the code still be processed?with widget logic, if you have 1 widget showing on a page, the code to display it is executed once. widgets not shown don’t get executed.
the code to work out if the widget is to be displayed gets executed, but not the widget code.
hope that helps
“eval()’d code on line 1”
tells us that the problem is in some of the widget logic in one or more of your widgets – something that uses in_array or a function that uses it. in this case it’s saying that the second parameter isn’t an array. have a check through your widgets for in_array statements. if you can’t see any, try copying a widget’s logic somewhere for safe keeping, blanking it and saving. try each widget in turn, and so on.
I might try adding code to trap errors and giving clearer feedback somehow.
Forum: Fixing WordPress
In reply to: Make widgets show up on particular pagesyou could try seeing if it works in a default theme – which would rule out/in if it’s your theme that’s doing something – otherwise it’s hard to diagnose where the problem might be.
Forum: Fixing WordPress
In reply to: Make widgets show up on particular pagesthe wp_reset_query option is at the foot of the widget admin page
http://wordpress.org/extend/plugins/widget-logic/screenshots/
i’ve just committed version 0.20 that uses WP’s own AJAX action method rather than my massively flawed attempt
Forum: Plugins
In reply to: "My" Widget for Recent Posts including all posts not specific categoryi think you need a different widget that will allow you to select categories.
is_single() || is_home() || !is_('products-page') || !($post->post_parent=='products-page'));has an extra bracket on the end if that’s any help