Skip to main content

Tonbo Biosciences

Our founder, Chris Clarke, developed the ecommerce platform, as well as the entire Order to Cash business process for Tonbo. We manage all HTML, CSS, Javascript, as well as LAMP stack development for Tonbo and evolved the site design to where it is today. Launched in January of 2013, Tonbo Biosciences is a biotech company in San Diego that focuses on flow cytometry reagents for immunology-based researchers.

How to change timezone on a Linux server (CentOS)

We run CentOS for many of our server builds and this question often comes up. Hope this helps.

Here are the steps:

  1. Make a backup copy of the default localtime file.
  2. [code]
    mv /etc/localtime /etc/localtime.bak
    [/code]

  3. Create a symbolic link to a new localtime file
  4. [code]
    ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
    [/code]

Be sure to replace “America/Los_Angeles” with the directory (if your zone has one) and filename of the timezone you want to use. Then test your change by running the command “date” from the command line.

UPDATE: Bootstrap Carousel = WordPress Dynamic Content

This is an update to my original post How to make Bootstrap Carousel display WordPress Dynamic Content, so I’ll keep it short…

The Original Source Code

From Twitter.Github.com/bootstrap
[code]

[/code]
Note: Bootstrap developers have added the .carousel-indicators feature sometime after my original post. Below, you will see my solution for generating the “data-slide-to” values dynamically…

Now with WordPress template PHP for dynamic content

[code]




[/code]
Of course you’re free to pass all sorts of arguments within the query_posts('/*your_arguments*/');. I’ve left out “posts_per_page” this time, allowing the default to be whatever you have for Dashboard Settings > Reading > Blog pages show at most = “?” posts.
Note: I’ve removed .active from the .carousel-indicators li, as well as from the .carousel-inner .item. We’ll add it back with jQuery…

Add “active” Class to first items

[code]
<script>
jQuery(document).ready(function(){
$(“.carousel-indicators li:first”).addClass(“active”);
$(“.carousel-inner .item:first”).addClass(“active”);
});
</script>
[/code]
The script must be called after the bootstrap js file, and preferably this is all happening in the footer.

Insert a Paged Blog Loop anywhere in your WordPress theme

[code]
<?php
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(‘post_type=post&posts_per_page=5′.’&paged=’.$paged); ?>

have_posts()) : $wp_query->the_post();?>


[/code]
Note that the <?php bootstrap_pagination();?> function has already been discussed in our post “Add Twitter Bootstrap Pagination to your WordPress Theme“.

I won’t spend too much time explaining this one. Just know that this will start an independent loop of your choice anywhere you want in your theme templates. And it correctly incorporates wp’s pagination feature, which can be tricky. I primarily use this code in a template I call blog.php. Many clients want either a static home page, or magazine-style home page, but still want a blog-reel displayed elsewhere (a la the common index.php). My blog.php template featuring the above code can be easily added to any internal page of their choice. Of course, there are countless ways to customize the query parameters.

What Happend to WordPress’ Media File URL Option?

Beats me! God only knows why the wp folk decided to hose that option, or maybe it’s a bug. Whatever the case my be, I thought the custom File URL option (found under Settings > Media) was a very handy tool of which I have always made good use, and I want it back real bad. So bad, in fact, I figured out how. Very simply add this to your theme’s functions.php file:
[code]
update_option(‘upload_url_path’, ‘/wordpress/wp-content/uploads’);
[/code]
Obviously, change the path to reflect your needs. Unfortunately, this hard-codes this path from functions.php, so although the field is added back to Settings > Media, and it may look like you can update the path from there, it will not save your changes. But in reality, a developer will only need to change this once or twice.

I find this option handy when developing a site at a temporary domain, knowing it will ultimately be migrated to a live domain. Otherwise, you get a fully-qualified temporary URL embedded in all your media attachments which are going to have to be changed anytime the site is moved to a new domain.
This option has saved me from the headache of having to mess with the wordpress mysql database more than necessary.

I will update this post as soon as I can add some convenience to this temporary solution.