365 Stories

flowing with the tides of life in 2010, an online journal
Browsing INTERNET & THE WEB

Custom sidebar blues finally dispelled

August8

For close to 3 months, I’ve been agonizing about creating custom sidebars for specific pages on the Diliman Prep website.

After long hours of searching for similar situations, diverted attention to the inspiring design pages of Smashing Magazine, passing through the learning curve of self-taught on-the-job training for basic php coding, too many sleepless nights and several dreams of solutions, I finally did it.

All the blogs and documents I was able to refer to tackled my concern in portions, perhaps because they too were writing only about their own concerns. Fact is, all of them were IT developers, while I have been introduced to php only when I decided to change certain portions of the wordpress themes I was using for my websites. I wish I can link to those sites that helped me understand the process, and will do so when I run across them again.

I desperately need to document the process that lead to the solution, if only so I could easily refer to this blog again whenever I wish to create custom sidebars to this blog site (which obviously needs the work) and to the other sites I will be creating.

Now if a reader finds this record useful for the php novice, that will be an exceptional bonus.

Creating Custom Sidebars in WordPress

Objective: Create custom right sidebars for different departments and concerns featured on the website. The left sidebar and the horizontal menu on top will be retained for overall site navigation.

Rationale: The same sidebar for all pages will eventually make the eye go blind on the items, notices, lists, that are on that sidebar, so that even if the items are quite important for the school to share, the reader will not consider it as such. He becomes blind to the item, unless it’s a list that need to be referred to every so often, like a category list or a topic list. But fixed images, and ads tend to be disregarded by the eye.

Also, the school also has myriad details that could be useful to the reader of certain pages, but these information would otherwise be hidden under and behind other material on the side. For example, readers interested in the Athletics Department would more likely be interested on who the coaches are and how to contact them directly. If this information was on the custom sidebar, the site is able to immediate meet the need of the reader.

Step 1: REGISTER new widgetizable sidebars  in the functions.php  file of the theme

Since my theme already has two functioning sidebars, the functions.php file has already been automatically created by WordPress. Here’s how my functions.php file looked like without the additional custom sidebars.

<?php
if(function_exists(‘register_sidebar’)) {

register_sidebar(array(
‘name’ => __(‘Left Sidebar‘),
‘before_widget’ => ‘<div id=”%1$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’
));

register_sidebar(array(
‘name’ => __(‘Right Sidebar‘),
‘before_widget’ => ‘<div id=”%1$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’
));

} ?>

I then registered an additional sidebar that I indent to use for the pages on the Athletics Department. The number 3 in the ‘Athletics 3′ is my reference to the actual number of the sidebar, which I will need later. I actually have a total of 15 custom sidebars. (The left sidebar is number 1. The main right sidebar is number 2.)

register_sidebar(array(
‘name’ => __(‘Athletics 3‘),
‘before_widget’ => ‘<div id=”%1$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h2>’,
‘after_title’ => ‘</h2>’
));

On the Appearance Widgets menu, I can now see the third sidebar named Athletics 3.

Step 2: Create a duplicate copy of the right_sidebar.php and a designate name that can easily be associated with the new sidebar.

I named my new custom sidebar right_sidebar-athletics.php and made sure that the call to the sidebar would refer to the custom sidebar for Athletics that I just made. Here is where the number 3 in the sidebar name becomes convenient.

<?php if (function_exists(‘dynamic_sidebar’) && dynamic_sidebar(3)) {  } ?>

[I was able to make the file copies using my freely downloaded copy of FileZilla, by selecting a file on my live server, right click Open/Edit. I changed the sidebar number to (3) and saved it with a new filename as above.]

Step 3: Edit the call for the new sidebar in the appropriate theme template file.

In my case, I opened the page.php file because I wanted to reflect custom sidebars on specific pages, to give the instruction to use the right_sidebar-athletics.php file in place of the standard right sidebar whenever the the active page is that of Athletics. The page ID for the Athletics page is 513, so I entered that in the call code.

<?php
if  (is_page(’513′))  {
include(TEMPLATEPATH . ‘/right_sidebar-athletics.php‘);
} else {
get_sidebar();
}
?>

Step 4: Add content to the custom sidebar.

Finally, on the Appearance Widgets menu, I opened the new sidebar that I named Athletics 3, and added my own html text and widgets (could be anything you want).

Then I shifted back to the window/tab of the website and clicked on the link to the Athletics page. YES, FINALLY, IT’S DONE. I had the new custom right sidebar up for the Athletics pagee, and retained the original right bar for all the other pages.

Within 15 minutes, I had gone through the whole process for 14 other website sections with pages that would benefit from custom sidebars.

But though I had finally solved the mystery of the custom right sidebar, the same did not work for the subpages.

Step 5: Generate a new conditional tag to check for subpages and apply the appropriate custom right sidebar.

I had seen the instructions for this the first time I searched the net, but could not make them work because the first 4 steps above were not yet in place. Now was the time to do so.  The solution turned out to be quite easy after the months of understanding php on my own.

I added a new function in the functions.php file to enable WordPress to check and identify the subpages.

function is_tree($pid) {      // $pid = The ID of the parent page
global $post;         // load details about this page
$anc = get_post_ancestors( $post->ID );
foreach($anc as $ancestor) {
if(is_page() && $ancestor == $pid) {
return true;
}
}
if(is_page()&&(is_page($pid)))
return true;   // we’re at the page or its subpage
else
return false;  // we’re elsewhere
};

“Add Snippet 4 to your functions.php file, and call is_tree('id') to see if the current page is the page, or is a sub page of the page. In Snippet 3, is_tree('2') would replace “is_page('about') || $post->post_parent == '2'” inside the first if tag.”   Refer to Snippet 4 in WordPress Codex on Conditional Tags.

And I replaced the conditional tag

<?php
if  (is_page(’513′))  {
include(TEMPLATEPATH . ‘/right_sidebar-athletics.php’);
} else {
get_sidebar();
}
?>

to this call in the pages.php file

<?php
if  (is_tree(’513′))  {
include(TEMPLATEPATH . ‘/right_sidebar-athletics.php’);
} else {
get_sidebar();
}
?>

After confirming that the codes resulted in the effect I wanted, I adjusted all the calls for the custom sidebars for the other web sections.

P.S.

I could actually have solved this problem much earlier, if only I had changed some of my work habits.  I finally realized that I had spent the worst hours of my day–when I was practically tired and ready to sleep– to study the possible solutions to custom sidebars. I had not given it the due attention during my more productive hours, thinking that I could extend my prime time to the hilt.

Sometime, the other night, I resolved to attend to the task at last 3 hours earlier than usual. Within an hour-and-a-half, I had solve the problem. Twas an exhilarating eureka-moment with the attendant heart-pounding and raised-arms as I refreshed the page and saw the new sidebar.

My next project: Using thumbnails of my posts photo in the excerpt on the Home page.

Lesson learned: Never overestimate my mental acuity when fatigue and sleepiness start to creep in. Sleep is necessary to revitalize the body and produce the new brain cells, that will enable me to challenge myself for the next project. Good night y’all.

Geocities.com is now Reocities.com

April15

I’ve always loved surprises. Who doesn’t? Today’s most pleasant surprise reminds me of those sleepless nights, 14 years ago, when I created my very first website.

The Dance Addict’s Guide is still online. Once hosted on Geocities.com between October 1997 to October 2009, it can now be found (in static form) at Reocities.com.

Geocities.com had been the home of some 7,000,000 websites when entrepreneurs were just starting to discover the power of online promotions and marketing. Its basic html frames technology may be considered “jurassic” in the age of css, xhtml and php, but it was the best option for amateur interpreneurs to create presence online.  Geocities.com too was the forerunner of the social networking sites that proliferate these days, we had webrings for sites with similar categories, and helped bring visitors to each other.

Thus in spite of the tedious process of site creation, my 140-page website entitled The Dance Addict’s Guide had created a presence in the field of ballroom dancing in the Philippines.  In fact it was the first and primary dance site in the Philippines for a while, (until I was locked out of the back office for not updating my email address). And it continued to bring me a good number of inquiries and clients from all over the world.

In October 2009, years after Yahoo acquired Geocities.com,  site owners were informed of the site’s closure by October 26, 2009. We were all asked to backup our site and download full copies if we wanted to keep any of our pages and images. I frantically searched for a site download program and utilized Teleport, a simple program that can duplicate any website, and create a browseable copy offline saved on one’s computer.

I hadn’t known then that someone who had recognized the many gems and treasures found on the millions of geocities.com web pages, and the need  to record the “historical artifacts” of the internet and the world wide web, was also frantically trying to backup all the sites that Yahoo was about to obliterate.

Thus, I am truly grateful to David Feinman for allowing us to reminisce our “youth” on the net, and continue to keep our presence online, though simulating a museum of sorts. (I wonder why I had chosen the “Museum” neighborhood in geocities back then.) Read about David’s miraculous efforts at saving the dinosaurs relics on the net.

Hands-on at web design

I had decided back in 1997 to seriously consider a career in dance, again, in spite of my increasingly excited interest in promoting my passion online.  That was the problem. I had wanted to do too many things all at the same time, as if I had just been let out of a prison cell.

So to combine my two major interests in one project, I decided to create a website on dance. The main objective was to interest more Filipinos to get interested in social dancing, and thus promote my own dance teaching business.

The whole website was practically done from scratch except for the fact that I used the free hosting from Geocities.com (many of the amateur web entrepreneurs back then did too) and utilized its simplified web designer program to upload the pages, images and other files online.

I had found an external program that I can’t now remember, to create the actual web layout. I experimented with columns and frames, grabbed free graphics from sharing sites, created my own graphic icons for the navigation bar, and even utilized some minor scripts for a running marquee bar, a guestbook, and a few tricks.

Over the next 6 months, I labored every day (and night), created metatags and links to many other sites, uploaded pages as they were completed, and started to promote my baby all over the net. I guess most of the basics I have obtained about web design, web management, SEO came from those few focused months. I worked mainly with CorelDraw, MS Word, and a web design program that skips my mind now. Checking how each change and improvement in the lay and design of the site took so much time (compared to what we can do theses days), but all that hard work did pay off.

Pretty soon, so many sites were linking and linked back to The Dance Addict’s Guide, a comprehensive resource to ballroom dancing in the Philippines, hosted by Geocities, with web address http://www.geocities.com/Soho/Museum/6962/.  I continued to submit my site to various search engines, and even created nickname URLs from some free sites available back then for free.

I had also attracted fellow dancer teachers online, including several who have made truly expansive contributions to the dance world. We exchanged information, ideas, and even dance books (oh, did I mention I also have portions of my dance book Victoria’s Dance Secrets on my website). I even got offers to work and manage a dance studio in South Africa, Singapore, and Denmark. And I made friends with so many lovely souls from all over the world and the Philippines,generated tons of emails and inquiries for dance lessons, and acquired hundreds of clients who are all my friends still.

Unfortunately, I had inadvertently locked out of my own site’s back-office and couldn’t update the site  since October 1999. I had decided to change email addresses when I changed my ISP, and failed to inform Yahoo about it. Yet, for the ten years, I continued to receive hundreds of email and phone inquiries emanating from The Dance Addict’s Guide.

Where to from here?

So, now I know that my site is still up, I am quite relieved that I can refer my friends to the site again. Unfortunately, though, the metatags don’t seem to work as they used to. Looks like I will have to mirror the site, update some pages, make it interactive again, and promote it again online. Hope to find the time to do that soon.

Perhaps too, I should convert my dance book Victoria’s Dance Secrets (originally titled Secrets to Modern Ballroom Dancing) into an ebook or, as at least  3 of my writer friends have suggested, into a series of ebooks. The current one just has too much information. One friend insists I should finally get rich selling information that I’ve known for so long and improving so much on.  I know I will have to take this most valuable advise soon.

Essentials to making money online

April2

A very useful short article I received in my inbox today talks about the essentials of making money online. It could very well work for just about any project these days.  Am posting it so I can regularly refer to the pointers, and remind myself whenever i become defocused by too many other interesting business ventures.  All italicized texts are mine.

Here’s my take on making money online. You can take it, you can leave it, but rest assured, it works. This really doesn’t need much more than a page, because the purpose here is to get you focused. (See tip #2) Now, get ready for the one-page report that could change your life.

The Essentials

#1. Take Action.
The most important thing you can do ever is take action. One of the biggest problems people have in online marketing is a thing called “Information Overload” and that’s mostly saying “I’m taking in so much information that I’ll never have time to implement it.” And yep, you can learn a whole bunch, really really fast online, but guess what? You’ll never be able to implement it all. So here’s our next tip:

There are zillion opportunities for anyone to make money online, but online will fit any single person’s disposition, goals, willingness to work, time, resources. One needs to research, ask questions, get recommendations. Check out if these are scams, and if people have actually earned from them. But once you’ve narrowed these down to your best 5 options for online business, take action.

#2. Take it one thing at a time
Not only is it important to take action, you really really need to do one thing at a time, whether or not it’s the best way or not. This is really important. When you’re brainstorming, you can think about all the possibilities, but when working on implementation, FOCUS. Don’t get scattered. Focus.

And like all business, be prepared to work. Nothing comes from nothing. Allow for some gestation period. Work on the business everyday, setting aside regular hours, even if it’s only one hour a day. The regular hours though can mean those one when everyone else is asleep.

#3. Get used to a ton of email
I get hundreds of emails every day. How often do I unsubscribe? Hardly ever. Unless it’s super annoying and entirely useless stuff, you’re best off keeping on the email lists, so you’ll always know what’s going on, and what to promote. You can organize it, and all that, but stop worrying about unsubscribing. If you don’t have enough space, get a free gmail.com mail account.

Yes, this is true, especially if you decide on pay-to-read-email programs. They’re quite easy to do, but you may need to sort our email into folders.

#4. You’ll need some things
You need a website or a blog (like this one), a Paypal account, a Clickbank account, and a autoresponder if you’re going to be marketing online. That’s just the bare essentials. Practically any legitimate program can pay you by Paypal or Clickbank. If they can’t, well… Check it out. Don’t spend too much time though, because it’s probably not worth it.

I have both Paypal and Clickbank, and will need to study how to use an autoresponder. Soon.

#5. The customer is always right
There’s nowhere near enough information about this in internet marketing. Sometimes customers can be really annoying, but if you treat your customers right, they’ll spend money on you. It’s that  simple.

Works for any business.  It’s the golden rule.

#6 You’ll need to know some things
You need to learn how to code HTML, and use FTP properly. If you don’t learn those, it’s going to be really difficult to succeed online. Also, you need to be able to write something convincing. Most marketers call that copywriting. Stack the odds in favor of somebody wanting to buy with value, and words, and you’ll do great.

If you checked out the “feeling bold” tab when you write a Note on Facebook, then you have a basic understanding of html. Most online affiliate programs will give you your own affiliate link to use (copy and paste) on your website or blog, just like the ones below.

That’s it. Thanks for reading. Now, Take Action! You’ll be glad you did.

Sincerely,
-Zech Smith ArticleWritingAssistant.com Churn Out Articles FAST!

Have site, blog, twitter?
Monetize your visitors!
Click here to learn more

Ewen Chia’s 24-hr Internet Business

Recruiting children on the net

March12

I was immediately alerted when I got a copy of the Manila Bulletin Fun Page blog entry which reads:

“Funpage is currently looking for kid writers, 7-14 years old, Besides an honorarium, kid writers get to review toys, attend movie premieres, and participate in cool events. Interested writers can send their sample articles to mbfunpage@yahoo.com. Use the subject line FUNPAGE WRITER. Writers in student publications are most welcome to join.”
http://funpage.net.ph/2010/03/06/wanted-kid-writers/

Surely there’s no harm to ask children to write review for toys, and attend movie premieres of children’s movies. However, I immediately felt a bitter taste in the mouth, seeing that this innocent online ad could have repurcussions later.

I personally feel that the poster/blogger did not intend anything beyond announcing the opportunity for more children to avail of goodies (toys, movies and an honorarium), and encouraging them to share their talents for writing and art.

So what makes this innocent ad alarming?

  • Too many children surf and regular using the internet without the benefit of adult guidance and monitoring. The proliferation of internet cafes that cater mostly to minors can attest to this. Media should not add to the problem, instead should refrain from recruiting minors to work for a fee or gifts,without the knowledge  of their parents.
  • The fact that the recruitment item was posted online, on an unrestricted blog site is further concern, for total lack of controls, especially for parental permission. The FunPage site is open to all types of people of all ages for comment ( as long as one provides an email address, which we all know can be easily obtained from various sites.) This means that any of our children can do the same, as well as scammers. The lack of registration requirements prior to commenting/posting not only provides another venue for as well as all the wolves, snakes and crocodiles online, but also absolves the blog owner of any responsibility for any of the posts, effects and resulting situations of such posts.
  • FunPage is published by the Manila Bulletin, which has the responsibility to safeguard and protect our children from practices that may jeopardize their safety.  Coming from a respected national newspaper, the ad implies that children can trust it, but can also build the an unnecessary habit of trusting similar ads from less respectable sources online. The innocent ad can thus become a precedent for less safe opportunities.
  • Honorarium is a form of payment for work.  Under Philippine law, children (below 18 years of age) are not allowed to work.

Some suggestions:

  1. FunPage/ Manila Bulletin should provide safety mechanisms for our children, and assume responsibility for any negative effects of using your WordPress.com blog site. Allow the youngsters to register on the site, but require that their parents or guardians are aware of their memberships and affiliations online.  Perhaps you can check the controls implemented by Yahoo and Google.
  2. FunPage / Manila Bulletin should course the offers/ events/ and activities through the registered schools, and or recognized parents forums, if any. The media outlet should not directly recruit children for any activities, online or not, without any assurance that it (Manila Bulletin) will take full responsibility for any results.  Please provide pages for Terms and Conditions, as well as Privacy Assurance.

All in the interest of making the net a safe place for our children.

REPLY FROM FUN PAGE

On March 17, 2010, Ms. Amyline Ching of Manila Bulletin’s FunPage, replied to my post. I am glad that we are coming from the same page, and that we share common intentions.

Good day ma’am. Thank you for your comment. Rest assured that we will take them into consideration and will enforce stricter security into the Funpage site. I understand where you are coming from. I, too, know of the dangers of the Internet and would like to provide a safe haven online where kids can have fun; develop their skills in writing and drawing; share their talent to others and inspire others their age to do the same without getting in harm’s way.

We will also rephrase and add some details to our advertisement so as not to give the impression that kids contribute articles to Funpage without their parents’ knowledge or consent. On the contrary, it is the parents that we first talk to before the kids themselves when we get their contribution and when they are considered as regular contributors of Funpage.  Schools are also informed by their parents that their kids contribute articles to the section.
Like you, we believe that children are the future think-tanks of this country. Rest assured that their welfare is paramount in our minds. In fact, it has been our mission to empower kids and help them develop their talents so that they can contribute much to the country when they grow up.  Again, thank you for your suggestions. Let’s work together so that kids will be safe and at the same time empowered.

Amyline Ching
Sub-section Editor – Moms&Babies, Manila Bulletin Lifestyle
Section Editor – Funpage, Manila Bulletin
amylineching@yahoo.com
5278121 local 358
09196632901

Catch Funpage and Moms&Babies (Lifestyle) every Saturday in Manila Bulletin!

365 STORIES CAN BE VIEWED
FROM MOST MOBILE DEVICES.

Subscribe

DOWNLOADABLE E-BOOKS

BABIES CAN (and did!) READ

FIVE RITUALS: SECRET TO
THE FOUNTAIN OF YOUTH

RUN YOUR CAR ON WATER

INSIDER SECRETS TO CHEAP FLIGHTS

OFFICIAL SECRET RESTAURANT RECIPES

PANIC AWAY - END ANXIETY & PANIC ATTACKS

SECRETS TO DOG TRAINING (SIT.STAY.FETCH)

GUIDE TO CREATING SPA PRODUCTS

500 SCRAPBOOKING SKETCHES

THE DIET SOLUTION PROGRAM

Hi, I’m Vikky, and I’ve finally made a New Year’s resolution that’s exciting and motivating enough to follow-through and resolve to attain.  Read about it in my first post and Why 365 stories?. This blog is just what it says — 365 Stories — one story (or more) everyday for the 365 days of 2010.

Discover CHIA seed, the ancient survival food of the Aztecs

My Sulit Homepage


Sign up for PayPal and start accepting credit card payments instantly.

    Buy and Sell Philippines    

        WordPress Themes by WPZOOM

    Adzelerate    

Links

Advertise On This Blog

Freelance Jobs