Mouthwatering Vegan Mediterranean Salad

I ran across a recipe for this Mediterranean salad at Mouthwatering Middle Eastern Style Salad Mouthwatering Vegan Recipes™. It looked so good I had to try it.

First, you chop up some veggies into small squares.

Start with cherry tomatoes…

Red peppers

… then add some red peppers …

Spring onions

… spring onions…

… Cucumbers…

… parsley …

… Garlic …

Finish off with some wild greens and canned white beans. Top it with homemade dressing and viola! … Salad is ready.

Yes, it tastes as good as it looks!

Tech Notes

I was looking for a better app to post from iPad. The WordPress app is OK, but I was not entirely pleased with it. After reading a review of Blogsy, I purchased the app. This is my first post using Blogsy.

Overall I have a good impression of Blogsy. On this post, however, I had some issues being able to place images where I want them. This may just be a learning curve. I’ll find out as I use it more.

Also, this post was done from home, where I have a full speed wi-fi connection. The real test will come on the road. I’m hoping Blogsy will help me make a post while I am away on an adventure, with no wi-fi service available. Of course, the blog won’t actually be posted until I get service, but I hope to be able to write the post and include all the pictures, ready for uploading.

Hosting Upgrade

I had some problems uploading images with Blogsy.  This turned out to be a limitation of my hosting package with my ISP.  An upgrade to the hosting package (same price as before) solved the problem.  The upgrade also positively affected my ongoing problems with child themes.

Child WordPress Theme

Today I noticed that the Arjuna-X Theme has yet another update.  Based on the last update, I would expect my custom taxonomies to break with the update, until I edited the theme to add them back in.  I researched the question, “Can I customize a theme and have the changes persist when the theme is updated?”

The answer is “yes”, and the means to do this is the Child Theme.  I promptly created a child theme with a functions.php file that registered my custom taxonomies.  Child theme functions are loaded in addition to the parent theme functions.  Since I’ve already modified Arjuna-X to add my custom taxonomies, I am not sure what would happen when the child theme redefined existing functions.  This seemed like an excellent opportunity to run an experiment.

  1. Create a new Arjuna-X-Child theme and upload to the server.  Do not activate it yet.
    1. A child theme requires a style.css file.  Since I am not making any changes to styles, I used the

      @import url(“../arjuna-x/style.css”);

      statement to bring in the parent Arjuna-X styles in their entirety.

    2. Create a new functions.php file containing the code to register custom taxonomies.
  2. Update Arjuna-X.  This should cause my custom taxonomies to stop working.  Result: As expected, custom taxonomies stopped working.  I noticed that the theme update instructions in my blog dashboard recommend using child themes for modifications.  Funny how I did not notice that last week.
  3. Change blog theme to Arjuna-X-Child.  Custom taxonomies should begin working again.  Result: my child theme showed up in the dashboard.  I activated it and custom taxonomies are back.  That was easy!
  4.  

Not so easy after all. The child theme broke the admin functions.  Login no longer works.  I had to revert back to the basic Arjuna-X theme and modify it, as before.

Time to continue the experiment.  The Arjuna-X functions.php file is quite complex and difficult for me to read.  I wonder if it is not structured in a way that is incompatible with the child theme I’m trying to create.  Hypothesis: The Twenty Ten theme will maximize compatibility, because it is developed as the default theme for WordPress.

The experiment proceeded as follows:

  1. Activate Twenty Ten as the blog theme.  Result: Appears to work as desired.  Theme does not have as many features as Arjuna-X does.
  2. Create a Twenty Ten Child theme and activate it.  This should add my custom taxonomies to the dashboard.  Result:  Blog displays OK, but when I attempt to Log Out, the dreaded “Cannot modify Header” warning appears.  I reset the active theme as Twenty Ten.
  3. Delete functions.php from the child theme.  This leaves only style.css.  Activate Twenty Ten Child theme.  Result: I was able to log out and back in.  No change in appearance from parent theme; working as expected.
  4. Add in the functions.php file exactly as shown in the WordPress example.  Result: The “Cannot modify header information” fault is back.  It appears that child themes are not working for some reason.
  5. I modified the function.php in the child theme to contain only <?php ?>.  No white space before or after the code.  Result: Problem persists.

At this time, I cannot use a child theme with a functions.php file.

2 May 2011 Update. I keep trying things, as this situation is bugging me.  A search of WP Forums gave a clue that perhaps a plugin is interfering with a child theme.  I disabled all plugins, but it did not help.

7 July 2011 Update. Lots of non-adventure life going on, so I haven’t done anything with the blog for a couple months.  I’m going to give up on child themes as I cannot figure out why I can’t get them to work.  I’ll have to get my taxonomies working by editing the main functions.php.  Then I’ll re-enable the plugins I had disabled a couple months earlier.

Because I don’t work with WordPress every day, I’ll document the steps I take in detail; that will help me later to remember what I did.

  1. I could not log in to edit the blog due to the “Cannot modify header information” fault from May.  Using FTP, I renamed the “twentyten-child” folder to “xxtwentyten-child”.  A page refresh displayed the dashboard.
  2. Since the twentyten theme is in fact simpler than Arjuna-X, I decided to try implementing my custom taxonomies in twentyten.  The hope is that it will be easier to learn the inside workings of WordPress.  First I copied the taxonomy code from my backup of Arjuna-X, then pasted it at the end of the functions.php file of twentyten, being careful not to leave any white space at the end of the file.  My custom taxonomies were back!
  3. In the process I noticed that WordPress 3.2 was out, and that it requires PHP 5.2.4 and MySQL 5.0.  I went to my ISP admin panel to verify the required versions were running.  MySQL was at 5, but PHP was version 4.  I changed PHP to version 5 (the exact version is 5.2.17).  This got me to wondering whether the old version of PHP was responsible for the troubles I’d been having with child themes.  So I ran another experiment.
    1. Verified that the twentyten-child functions.php file contained only the PHP start tag and a comment.
    2. Activated twentyten child theme.
    3. Better … the error is gone, but the theme does not display properly.  No widgets.
    4. I had been importing the style.css file in the child theme.  Now I deleted that file and copied style.css from twentyten to twentyten-child.  Now the child theme works just like the parent, widgets and all.
    5. Last step is to add in the functions.php file to the twentyten-child directory.  I did this and the custom taxonomies reappeared.  Yay!
    6. OK, not so Yay.  I seem to have duplicated the original problem. :(

Summary


I’ll summarize for the next time I come back to this.

Here’s the error line, which gets repeated multiple times:

Warning: Cannot modify header information – headers already sent by (output started at /homepages/9/d271285184/htdocs/wp-content/themes/twentyten-child/functions.php:1) in /homepages/9/d271285184/htdocs/wp-login.php on line 354

The error gets flagged on the first line of the child theme’s functions.php.  I know the problem is there because the line number (functions.php:1 in the example above) changes if I insert blank lines at the start of the file.  Here is the beginning of functions.php:

<?php
/**
 * Register custom taxonomies
*/

Environment

WordPress version:  3.1.2

PHP version:  5.2.17

MySQL version: 5.0

Parent theme: Twentyten

All plugins are disabled.

Symptoms

  • Problem manifests during admin type functions, such as login, logout, and editing of posts.
  • Problem is always associated with the PHP start tag in the child theme’s functions.php file.  Line number of the warning moves with the start tag as blank lines are added to start of file.
  • Problem does not manifest if the code in functions.php is directly added into the parent theme’s functions.php.
  • Problem does not manifest for non-admin functions such as navigating posts.
  • Problem does manifest for leaving comments.  Comment will post, though the error occurs.  No problem if there is no functions.php in the child theme folder.

Troubleshooting

  • Using the latest versions of PHP and My SQL.
  • WordPress 3.1.2 should not have this problem.  I will update to 3.2 soon, but don’t expect anything to change.
  • The child theme’s functions.php has no white space at the end.
  • Tried with and without a closing PHP tag.  No difference.
  • Found some comments on the net that the opening PHP tag should have a trailing space.  Tried with and without; no difference.  Also tried the opening tag using the two variants below, also with and without trailing spaces, with no difference.
<?
<?php
  • My text editor allows end of lines to be of three variants.  I tried all three without effect:
    • Unix (LF).  My server is Linux so this should be the best choice.
    • Mac (CR).
    • Windows (CRLF)
  • I suspected a permissions problem.  Admin functions and leaving comments differ from browsing posts by writing data.  So I tried the following:
    • Add group write privilege to wp-content folder and contained files.  Did not help.

Files

Here are the files in the child theme folder:
style.css

/*
Theme Name: Twenty Ten Child
Description: Child theme for the Twenty Ten theme.  Adds custom taxonomies.
Author: Andy Arkusinski
Template: twentyten
*/

@import url("../twentyten/style.css");

functions.php

<?php
/**
* Register custom taxonomies
*/
add_action( 'init', 'create_my_taxonomies', 0 );

function create_my_taxonomies() {
register_taxonomy( 'place', 'post', array( 'hierarchical' => false, 'label' => 'Place', 'query_var' => true, 'rewrite' => true ) );
register_taxonomy( 'history', 'post', array( 'hierarchical' => false, 'label' => 'History', 'query_var' => true, 'rewrite' => true ) );
register_taxonomy( 'activity', 'post', array( 'hierarchical' => false, 'label' => 'Activity', 'query_var' => true, 'rewrite' => true ) );
register_taxonomy( 'device', 'post', array( 'hierarchical' => false, 'label' => 'Device', 'query_var' => true, 'rewrite' => true ) );
register_taxonomy( 'software', 'post', array( 'hierarchical' => false, 'label' => 'Software', 'query_var' => true, 'rewrite' => true ) );
}

GeoMashup Locations

I’m learning how to use the GeoMashup plugin for WordPress.  I still think it is a cool plugin, but some frustrations have arisen.  Since I am a complete novice at WordPress, PHP, MySQL, etc., my basic knowledge level may not be high enough to understand the documentation that comes with the plugin.

What’s missing is a GeoMashup for Dummies tutorial.  The plugin author provides a couple basic paragraphs, then dives right into the details of programming the plugin.  So I’m going to document my understanding of what is happening in the plugin.  This will help me, and maybe help others.  Of course, I’m sure my understanding will grow over time.  I’ll try to keep the blog up to date.

Locations

I started out thinking in terms of a map.  The basic object on a map is a location.  I think of a paper map with a push-pin marking the location.  The pin (location) has attributes (latitude, longitude) that are used to locate it on a map.  So I’m thinking I need to get a list of locations into my blog, and I can locate them on a map.

Wrong answer!  WordPress is blogging software.  Its basic objects are posts, comments, pages, and users.  There is no location object, like a push-pin.  What the GeoMashup plugin did was add a location attribute to WordPress objects.  Now a Post object has a Location attribute, etc.

This is a fundamental change in my thinking, and I’m still getting used to it.  The markers on a map represent posts and pages, not locations themselves.

For a trip I’m currently planning, I want to show markers for all the places I’m considering going to.  From that map, I can refine destinations, where to stay and for how long, etc.  Since several people are going, and they are located in various parts of the country, we are using a blog page to coordinate the planning.  At this time, there is no way to get a list of locations into WordPress.  I can only get a list of posts into WordPress.  This means I write a post for each candidate location on the itinerary, and assign a location to the post, so the post can be marked on a map.  This will make the blog look messy.

Maps

GeoMashup has three types of maps.  Here are the definitions from the documentation.

  • Global Maps: Global maps can include multiple located objects in various combinations.
  • Single Maps: These options are like the Global Maps options, but are applied to maps in and of single posts.
  • Contextual Maps: These options are like the Global Maps options, but are applied to maps that are based on a list of posts currently being displayed.

So far I have figured out that the maps work this way:

  • If the page on which the map is displayed does not have a location attribute, the map will display all objects with locations.  Filters can be applied (I’m still learning about them) to select which objects will be displayed.  This is a Global Map.
  • If the page has a location, that location will be displayed on the map.  This is a Single Map.
  • I’m not sure how to use a Contextual Map.  It must be in the documentation somewhere, just waiting for me to get smart enough to recognize it!

Geo Mashup Plugin

Tonight I installed the Geo Mashup plugin for WordPress.  This plugin promises to turn WordPress into a GeoCMS (content management system).  It allows you to tag posts and pages with location information, and insert Google maps into pages, with the locations marked.  I was able to insert a Google Map onto a blog page.  It was easy, and looks sharp!  I’m excited!

Because Geo Mashup is located in the WordPress Plugins Directory, I was able to install it directly from the WordPress Admin page, Plugins panel.  Installation instructions are provided in the Geo Mashup Wiki.  Everything proceeded nominally, without any exceptions to the instructions.  You do need a Google API Key for Geo Mashup to work, and to get the Google API  Key, you need a Google account.  Fortunately I already had a Google account, so that saved a few steps.

After activating the Geo Mashup plugin, a Location panel was available for the new Big Trees Trip page.  I searched for Redwood National Park, saved the location, and inserted the shortcode for the map on the page.  Viola! there was the map with a marker at the Redwood National Park.  You are supposed to be able to insert maps in posts as well, so I am going to try that right now.

WordPress Taxonomies

As I considered how to organize my site, I searched the web for advice.  I came across this wonderful site by Scott Ellis.  On his site I found an article on “A Basic Explanation of WordPress Taxonomies“.  It’s a cool way to categorize my site, so I will try to use taxonomies.  I fully expect my site organization to change, as I’m brand new to this.  If it’s not working, I’ll change it!

My Taxonomies

I plan on having three top level categories on this site:

  • Travel: Trips I am planning or have taken.
  • Technology: Computers and gadgets, including software.
  • Home: Things that happen where I live and work.

For each Category, I’ll define a set of taxonomies.  Taxonomies are just a way to organize the posts.  Within a Category, each post can be described by all the taxonomies assigned to the category.

Within the Travel category, there are three taxonomies: (with example terms)

  • Place: (Santa Fe, Bosque del Apache, Mesa Verde)
  • History: (Spanish Colonial, Native American)
  • Activity: (Birding, Museum Visit, Geocaching)

Within the Technology category there are also three taxonomies: (example terms)

  • Device: (desktop, laptop, cell phone, GPS, modem, scanner, web site)
  • Software: (iPhone app, financial, WordPress)
  • Activity: (blogging, finances, pay bills, networks)

Within the Home category:

  • Place: (Master Bath, garden)
  • Activity: (remodel, gardening)

Seems like there ought to be a third taxonomy applying to Home, but it eludes me right now.

Taxonomy Code

I got the code for implementing taxonomies from a post by Justin Tadlock, “Custom Taxonomies in WordPress 2.8“.  Here’s what I used in my blog:


< ?php add_action( 'init', 'create_my_taxonomies', 0 ); function create_my_taxonomies() { 	register_taxonomy( 'place', 'post', array( 'hierarchical' => false, 'label' => 'Place', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'history', 'post', array( 'hierarchical' => false, 'label' => 'History', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'activity', 'post', array( 'hierarchical' => false, 'label' => 'Activity', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'device', 'post', array( 'hierarchical' => false, 'label' => 'Device', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'software', 'post', array( 'hierarchical' => false, 'label' => 'Software', 'query_var' => true, 'rewrite' => true ) );
}
?>

(The above is supposed to be a text box with scroll bars. That is exactly what it is when I look at it in the editor. However, when published the scroll bars disappear. I think it is a limitation of WordPress. I’d appreciate some comments from anyone that knows for sure.)