alanft
Forum Replies Created
-
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Is there a "is_subpage" alternative?one of the sample codes on http://wordpress.org/extend/plugins/widget-logic/other_notes/ is
global $post; return (in_array(77,get_post_ancestors($post))); — WP page that is a child of page 77
if you can get the page ID number of ‘california’ that might do you.
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Not display correctlyCurious. Try changing the value of the “Load logic” point on the widget options page, to see if that makes any difference.
Do you use the wp_reset_query fix option? I’m very much aware that this function needs to work differently since 0.50, but have had little feedback about that.
One possibility would be
* save an up-to-date WP backup
* restore from an old backup when you had WL code
* save out the WL options using the new export options
* restore the DB again from the up-to-date backup
* import the WL optionsYou can see the new WL export/import options on the screenshots
http://wordpress.org/extend/plugins/widget-logic/screenshots/
If save/restore is too big/slow you could delve into the SQL backup and pull out the “widget_logic” option field in wp_options table. though it will be serialised – so this might be a bit out of your “coding comfort zone”
Forum: Plugins
In reply to: [Widget Logic] Syntax Error with Widget LogicGreat stuff.
Based on your description of what you are trying to achieve you might want to try
!is_category(array(3,256)) || !(is_single() && in_category(array(3,256)))
and see if that improves things
Forum: Plugins
In reply to: [Widget Logic] Syntax Error with Widget LogicYou have one more ( than you have ), which is why you are getting a “PHP Parse error: syntax error”
Forum: Plugins
In reply to: [Widget Logic] Syntax Error with Widget LogicThere’s something awry with some of your widget logic code where you have a stray or extra ‘{‘ bracket.
export all your widget logic code to a config file for safe keeping and trawl through the widget logic in each widget looking for bad code – or just blank the code and see if that fixes it if it’s complicated. then you can restore it from the config file
Hard to say why that would happen – eg you could have accidentally edited in a paragraph mark at the top of the plugin PHP.
So the first thing I recommend is that you put your function in to your theme’s functions.php. And then use the late loading option ‘after the theme loads’ so that the function can be ‘seen’ by your various widget logic (see configuration options in the installation tab)
http://wordpress.org/extend/plugins/widget-logic/installation/
Then revert widget logic code to a fresh install.
Hi, this topic is marked as resolved. Is all well, then? (or did you just go back to .51)
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Delayed Logic Loadingalso, as ‘use cases’ for the different load points become clearer. It’s not a feature I make use of in my own installations, but I’ve had people in a variety of situations that I *believe* can be fixed with one of these options.
(Thanks for giving me this platform to put this out there – I nearly self posted about it, but worried it wasn’t of enough interest)
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Delayed Logic LoadingThere’s a little bit under the installation tab
http://wordpress.org/extend/plugins/widget-logic/installation/
TBH I am struggling with a succinct way to explain it, so will probably revise this a couple of times as queries come in
Forum: Plugins
In reply to: Widget Logic / Widget Context replacing callback3.3.1 i’m happy with (and the user compatibility widget says 50 v 2), and I’ve just updated the home site i test with on 3.3.2 and it’s working fine.
It’s worth mentioning there’s a dev version to test too with a couple of important additions in it. I’ve got no way to ask people to beta test that for me. So i’ll probably just commit that soon, as it works fine for me.
Forum: Plugins
In reply to: Sidebar widget entries not showing up on Twenty Eleven.I am adding an item in the FAQ about the problem I believe you are having. Which is that you need the wp_reset_query_fix option ticked
http://wordpress.org/extend/plugins/widget-logic/screenshots/
This is because of this little known gem
http://codex.wordpress.org/Function_Reference/is_page#Cannot_Be_Used_Inside_The_Loop
where is_page is no use in a sidebar used after (or inside) the main ‘Loop’
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Shopping Cart Widget Fatal ErrorI have added loading time options to the development version
http://wordpress.org/extend/plugins/widget-logic/download/
It’s a new drop down option “Load logic: …” on the widgets page along with the other widget logic options.
I’d be obliged if anyone seeing this would try it out and let me know if it’s OK, failing, has fixed problems, made things worse, etc.
Added to the dev version since .51 are these optional ‘load times’, and a export/import all WL settings
Forum: Plugins
In reply to: [Widget Logic] [Plugin: Widget Logic] Error First argument should be an arrayW Logic and W classes use different, but related, ways of intercepting the control on the widget’s config page which I think are mutually incompatible.
WL adds the ID to the widget’s params, WC replaces the params with just the ID, saving the params elsewhere. You could try expanding line 67 of WL to something like
if (is_array($wp_registered_widget_controls[$id]['params'])) array_push($wp_registered_widget_controls[$id]['params'],$id); else if (isset($wp_registered_widget_controls[$id]['_params'])) array_push($wp_registered_widget_controls[$id]['_params'],$id);but i’ve not tried it as i’m way too lazy at the moment, sorry.
All respect to the writer and users of WC, I don’t see what WC is for as widgets already have CSS classes, and blocking different classes together in the CSS code seems like less coding overhead.
Forum: Plugins
In reply to: How to display different sidebar content based on the author of a post?i haven’t found a widget that shows the author bio, but I haven’t looked in ages and there’s probably one out there now. You’d then set this up to show on
is_single()
i suspect – if you persist with Widget Logic.
FWIW, here’s the widget I wrote years ago to do it though:
function blog_author_bio($args) { global $wp_query, $userdata; extract($args); $author_obj = ($wp_query->post); $author_obj= get_userdata($author_obj->post_author); $title=($author_obj->user_nicename); if ($author_obj->user_firstname) $title=($author_obj->user_firstname)." ".($author_obj->user_lastname); echo $before_widget . $before_title . $title . $after_title; if ($author_obj->user_description) echo substr(apply_filters('category_description', $author_obj->user_description),3); else echo "<p>No biography available.</p>"; if ($userdata->ID == $author_obj->ID) { ?><p><a href="/wordpress/wp-admin/profile.php">Edit your Biographical Info</a></p><? } echo $after_widget; }which is registered with
register_sidebar_widget('Author Bio','blog_author_bio');