Genesis: Filter frontpage posts by category

If you want to show a single category on your homepage, just copy the code below and add to your functions.php. The code can be adapted for multiple categories as well, just separate each category ID with a comma.

/** Filter frontpage posts by category
 *  Change 6 to your Featured category ID, if you want to show multiple categories just use a comma to separate the category IDs
 * @link http://www.khleomix.com/genesis-filter-frontpage-posts-by-category/
 * @author JC Mae Palmes
 */
function filter_home_category( $query ) {
	if( $query->is_main_query() && !is_admin() && $query->is_home() )
		$query->set( 'cat', '6' );
}
add_action( 'pre_get_posts', 'filter_home_category' );

WordCamp Philippines 2012 and I’m going

I started working with WordPress 5 years ago and this is the first time that I’m going out of my way to attend WordCamp. I’ve been thinking of going a month ago but was undecided because it would mean leaving the kids and my hubby at home to go to Manila. But the decision has been taken out of my hands when Allen decided to attend as well. The kids are also going with us to meet with their homeschool provider (The Master’s Academy) so its hitting two birds with one stone.

So, am I excited? A bit… What’s really holding me is the amount of work that I need to leave in order to go to Manila. But a girl’s got to have some time off, right? And it would be nice to meet like-minded peeps and learn from them.

Its not too late to register, just head on to the WordCamp site and register. Or you can click this link. The ticket is Php 1,300 per person which includes the official WordCamp 2012 t-shirt and some cool schwag.

WordCamp Philippines 2012
October 27, 2012
8:00 AM – 6:00 PM
Asian Institute of Management
123 Paseo de Roxas
Makati City, Metro Manila
Philippines

If you want to add the event to your google calendar, click the button below:

Malware? Here’s a quick fix

Some of my sites have been infected with malware before and it was FUN! not. Here’s a quick fix you might want to try, saved my neck on more than one occasion.

How To: Find and replace text in PhpMyAdmin using SQL

Sometimes, you just need to manually edit the database in order to replace one value with another. If its just say 1-10 entries – it wouldn’t be a problem going through them one by one. But what if there are hundreds of entries, will you manually edit them one by one? I wouldn’t… So here’s a handy snippet for those who want to edit in one go, as always BACKUP (!!!) before you do anything. I can’t stress that enough, but believe me your backups will be your lifesaver. Anyways, login to your phpmyadmin, click on the database that you want to edit. Do a search for the text that you want to replace. Open SQL and use the command below, replace the strings with the proper ones:
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, 'find this string', 'replace found string with this string');

Two Years in the making…

I really should get back to blogging and updating my sites. I don’t know what came over me a few hours ago but when I checked khleomix.com I saw that the last relevant post I made was almost two years old. TWO YEARS OLD! That makes me want to hide in my little invisible cubbyhole, right beside the books I’ve been meaning to read but never got around to.

Writing has always been my passion but because of circumstances that are way beyond my control I stopped. Well, not exactly stop. I just changed the way I write – I traded my emotional pen to a technological one. I no longer write words that provoke the emotions, I now write words to provoke the inanimate. Necessity has transformed me into a writer of codes. I don’t regret going the path that I am now on – my only regret was that I stopped writing. My work feeds my mind but not my emotions. I know that now and I think that that’s the one thing that makes me feel incomplete.

I know it took me two long years and I’m not sure if I can keep it up but I will try. I’ve also started using a calendar today – I find it annoying but it might help me prioritize. I also set aside time for homeschooling lessons on a set schedule instead of me going about it whenever and if I can.  So a calendar is a must – one that has the MOST annoying notification sound ever. I hate it but it gets me to do stuff…

Socialite wordpress plugin error

If you are trying to use the Socialite plugin and your wordpress version is 3.0+ then you’re bound to get this particular error:

Warning: unserialize() expects parameter 1 to be string, array given in .../wp-content/plugins/socialite/include/socialite.inc.php on line 49

The fix is actually very simple but you would need to have a some knowledge in editing php codes or at least the tenacity to try… Don’t fret the process is just download, open, find, copy and paste and upload. You would need an ftp client to download and upload and a text editor (if you don’t have dreamweaver or the like, notepad will do) to edit the needed file. Or you can always use the native plugin editor of wordpress.

If you’re going to use ftp, download the socialite folder under wp-content/plugin/, open the file socialite/include/socialite.inc.php. Find the following (CTRL+F will do wonders):
// now unserialze the options to get the array of values
$this->options = unserialize($this->options);

around line 48-49

replace: $this->options = unserialize($this->options);
with: $this->options = maybe_unserialize($this->options);

find:
// options are stored serialized into the wp_options table
$val = serialize($opts);

around line 73-74

replace: $val = serialize($opts);
with: $val = maybe_serialize($opts);

Save the file and upload. That should be good until the next update.

The reason: This plugin is not compatible with wordpress 3.0.  The newest wordpress version automatically serializes/unserializes data and since the plugin has not been updated, it still uses the old code thus the unserialize warning.

And of course, for those who are afraid of editing their files you can download the fixed socialize plugin after the jump

JUMP

Fatal error: Call to undefined method wpdb::get_blog_prefix() problem

If you just upgraded to WordPress 3.0 and is using the db cache reloaded plugin, you might encounter the following error when you try to access some pages in your admin:
Fatal error: Call to undefined method wpdb::get_blog_prefix() in …/public_html/wp-includes/user.php on line 445

The fix is pretty simple:

  1. disable the plugin.
  2. manually delete the wp-content/db.php
  3. delete the offending plugin
  4. if you must need to use a caching plugin, I believe there is a patch around (google is your friend). the patch should be good until the plugin developer updates the plugin to be compatible with wordpress 3.0

Can’t upgrade to WordPress 3.0?

Its been too long and I’ve neglected my own site, so here I was checking out my admin, deleting spam, upgrading plugins and was about to upgrade to WordPress 3.0… Everything went fine except the wordpress 3.0 upgrade.

When I pressed the upgrade now link, it redirected me to a page with this message: “You are not allowed to call this page directly.” Of course, I was about to pull my hair out (nah…), but Google will always be your friend although a little bit tricky this time. So I’ll save somebody else a few minutes of trouble.

If you get the “You are not allowed to call this page directly.” message, deactivate your NextGen ImageFlow plugin and try again. Don’t worry you can activate it again as soon as you’re done upgrading.

A brand new site

I finally managed to start on my own site although I still have gazillion more projects to finish. This site is still a work in progress and content are mostly blank for now. I’ll eventually get to it… somehow…

I’m not really sure if I like the layout, but its a start… I do love the overall effect and I am currently in love with the colors. I think I’m going to implement the same layout in BeThumbed which is totally in need of a makeover… Or I might do something totally different.

Its 2AM and I’ve been working since 10AM yesterday, I should be tired but I’m not sure I am yet. I think I’ll start on one of my new projects or maybe finish the current ones. My mind is a mess, but then again, it usually is and I thrive in madness.