Title: lawless's Replies | WordPress.org

---

# lawless

  [  ](https://wordpress.org/support/users/lawless/)

 *   [Profile](https://wordpress.org/support/users/lawless/)
 *   [Topics Started](https://wordpress.org/support/users/lawless/topics/)
 *   [Replies Created](https://wordpress.org/support/users/lawless/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/lawless/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/lawless/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/lawless/engagements/)
 *   [Favorites](https://wordpress.org/support/users/lawless/favorites/)

 Search replies:

## Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Print Invoice & Delivery Notes for WooCommerce] PHP fatal error since update to 7.2.0](https://wordpress.org/support/topic/php-fatal-error-since-update-to-7-2-0/)
 *  Thread Starter [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/php-fatal-error-since-update-to-7-2-0/#post-18954438)
 * [@wpupen](https://wordpress.org/support/users/wpupen/) Thanks!
 * I just manually updated the plugin and am waiting for the client to confirm it’s
   working as expected.
 * I’ll upate here once I find out.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Mobile Detect] Old version](https://wordpress.org/support/topic/old-version-10/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/old-version-10/#post-8680243)
 * You can find older versions here:
    [https://wordpress.org/plugins/wp-mobile-detect/developers/](https://wordpress.org/plugins/wp-mobile-detect/developers/)
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Recent Posts Widget with Category Exclude hack failing](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude-hack-failing/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude-hack-failing/#post-8203296)
 * Little more info. The title, number, and exclude data are being store in the 
   database in the *yourprefix*_options table. Do you have access to your database
   via phpMyAdmin or something similar?
 * There is a field in the ‘option_name’ column called ‘widget_recent-posts’, that
   stores the values in an array that looks similar to this:
 * a:2:{i:2;a:3:{s:5:”title”;s:0:””;s:6:”number”;i:5;s:7:”exclude”;s:1:”1″;}s:12:”
   _multiwidget”;i:1;}
 * So caching shouldn’t affect that. It’s persisted in the database.
 * Widgets are weird little creatures and I’ve never fully understood them. I’ve
   run into similar issues in the past, usually when migrating sites where I’d lose
   all Widget data.
 * The weird thing in your case is the intermittent behavior. Like bcworkz said,
   it should just work or not work.
 * Can you give us any more context as to when it ‘forgets’ the exclude category?
 * Making new posts, when a comment gets added, etc. That may help identify some
   action that is triggering a behavior that is causing the problem.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Recent Posts Widget with Category Exclude hack failing](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude-hack-failing/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude-hack-failing/#post-8203240)
 * [@trisham](https://wordpress.org/support/users/trisham/), I just got an email
   since you [@lawless](https://wordpress.org/support/users/lawless/)’d me.
 * I just dropped that code in a current site I’m working on and it seemed to work
   as expected. I’ve got error reporting turned on, and the only thing I saw was
   a warning about an unset variable which wouldn’t cause your issue.
 * In digging deeper it seems since WordPress 2.5 the wp_cache function this code
   uses, does not store wp_cache data persistently, which my be why you are seeing
   intermittent issues. The Exclude Category value gets stored in wp_cache, then
   once the cache is destroyed, your Category value gets removed.
 * My guess is it’s somehow related to that. I just dug into it a little bit and
   didn’t see anything obvious, but it’s been 4 years since I’ve even looked at 
   that code. I’ll try and play with it a little more this week in my spare time.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Recent Posts Widget with Category Exclude](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/)
 *  Thread Starter [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/#post-2806640)
 * Cheers. Funny, every couple months someone stumbles onto this post and the Recent
   Posts w/ Category Exclude widget.
 * I don’t even remember what project I used it in now, and haven’t used it since,
   but it’s good to see others getting some use out of it.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [After updating to 3.4 the "login_headerurl" & "login_headertitle" stoped wor](https://wordpress.org/support/topic/after-updating-to-34-the-login_headerurl-login_headertitle-stoped-working/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/after-updating-to-34-the-login_headerurl-login_headertitle-stoped-working/#post-2836887)
 * Something definitely changed in core to break the old way of doing it. I had `
   echo` statements too and had to change them to `return`.
 * I also noticed they now have a CSS `background-size: 274px 63px;` that has to
   be overwritten if you’re using a custom login logo. I’m having to write in a 
   CSS style for `.login h1 a` to set the background-size to the exact size of my
   custom login logo.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Recent Posts Widget with Category Exclude](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/)
 *  Thread Starter [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/#post-2806550)
 * Recent Posts Widget with Category Exclude:
    [http://pastebin.com/jxDnqPqR](http://pastebin.com/jxDnqPqR)
 * Just drop that whole thing in your theme’s functions.php file and it will turn
   the Recent Posts widget into a Recent Posts with Exclude widget.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Recent Posts Widget with Category Exclude](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/)
 *  Thread Starter [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/recent-posts-widget-with-category-exclude/#post-2806549)
 * Link posted below.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [Excluding post categories from my gallery.](https://wordpress.org/support/topic/excluding-post-categories-from-my-gallery-1/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/excluding-post-categories-from-my-gallery-1/#post-2790990)
 * Hey jma666, I just ran into a similar problem with category__not_in, `'category__not_in'
   => array( 144, 145 )` seems to get processed as a string instead of an array,
   for whatever reason.
 * Try putting your exclude IDs into a variable and explode that into an Array for‘
   category__not_in’. This is how I got it to work in my circumstance.
 * Try this example of your code:
 *     ```
       <?php
       $excludes = '144,145';
       $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts( array(
       'category__not_in' => explode(',', $excludes),
       'post_type' => 'gallery',
       'posts_per_page' => -1,
       'ignore_sticky_posts' => 1,
       'orderby' => $gogo_gallery_items_order
       					 )
       			  );
       $postcount = 0;
       if ( have_posts() ) : while ( have_posts() ) : the_post(); $postcount++;?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [2.9.2 site hacked](https://wordpress.org/support/topic/292-site-hacked/)
 *  [lawless](https://wordpress.org/support/users/lawless/)
 * (@lawless)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/292-site-hacked/page/5/#post-1491762)
 * Here’s GoDaddy’s response on their Support page:
 * [http://community.godaddy.com/godaddy/wordpress-compromised-how-to-fix-it](http://community.godaddy.com/godaddy/wordpress-compromised-how-to-fix-it/)
 * Pretty lackluster considering the scope of this problem.

Viewing 10 replies - 1 through 10 (of 10 total)