Paste your Bing Webmaster Tools verification code here Paste your Google Webmaster Tools verification code here

How do i get all the taxonomies of a node to render in Drupal7?

After following a tutorial for getting the taxonomy terms of a node, I found that I still didn’t have all the pieces of the puzzle. Doing a foreach over $tags = $node->field_tags; would just give a disappointing one result with those nodes had more than one taxonomy assigned to it. (The other 3 were being lost in the code abyss!)

This was solved by digging a little deeper into the object that was return:

<div class="tagsList views-field-field-tags">
	<? $tags = $node->field_tags['und']; ?>                            
	Tags: <? $count = 0; 
	foreach($tags as $tag){ 
	if($count > 0){echo ", ";}
	echo '<a href="'.taxonomy_term_path($tag['taxonomy_term']).'">'.$tag['taxonomy_term']->name.'</a>'; 
	} ?>

Turns out i had to go one layer deeper to loop the tags object as the language code is undefined. SO now my taxonomies are working great on the node.tpl.php for that feed.


How do I manually jump to a specific slide in Flexslider?

This is such a quick fix, yet very few places on the internet seem to know the 4 lined solution to this problem. If you are using the FlexSlider plugin, you may come across the scenario where you need to jump to a specific slide – no animations attatched. Just a good old fashioned goTo action.  I found that while my other search terms failed, looking for changing the flexslider settings after initialization had something to it.

This is how i initialized my flexslider:

	animation: "slide",
	slideshow: false,

Later in the code when i wanted to jump to a slide:

var slider = $('#whyslider').data('flexslider');
var animationSpeed = slider.vars.animationSpeed; 	//save animation speed to reset later
slider.vars.animationSpeed = 0;
slider.flexAnimate(3); 					//position index for desired slide goes here
slider.vars.animationSpeed = animationSpeed;


Import Microsoft Access .accdb File to MS SQL Server

These steps are for exporting an .accdb file if it cannot be viewed as a table. This may be needed if the data file was generated by a Microsoft Access form. If the desired file can be viewed as a table in MS Access, then skip these steps.

  1. Open up the TechData .accdb file (not a form file).
  2. In Access 2013 in the database tools tab click the “Access Database” button under “Move Data”.
  3. Follow the wizard to split the database.
  4. Open the *_be.accdb file that was created to gain access to the database tables.

Import to MS SQL Server

  1. Open MS SQL Server Import and Export Wizard.
  2. For “Data Source” choose “Microsoft Office 12.0 Access Database Engine OLE DB Provider”.
  3. Click “Properties” enter the location of the .accdb file in the “Data Source” field.
  4. Under login information, choose a blank username and be sure to check “Blank Password”.
  5. Test the connection. If it works, click OK.
  6. For the “Data Destination” choose “Microsoft OLE DB Provider for SQL Server”.
  7. Enter the MS SQL server name or choose from the dropdown menu.
  8. Enter your SQL credentials and select the database you wish to import the data to, the database should show up in the dropdown menu if your MS SQL info is correct.
  9. Select “Copy data from one or more tables or views”.
  10. Select the tables you want copied and edit the mappings if needed.
  11. Continue through the wizard and hit finish to begin the import.

I adapted this to the MSSQL Import/Export wizard using this guide. The info for entering data at step 21 and at step 29 was particularly useful.

Play Youtube Videos on Scroll Over

So one thing that I set out to do on a project was implement the new autoplay video that kinda works well on Facebook. Let’s do this with some Youtube videos.

When a video appears in your scroll view, it automatically starts to play on mute.

I use Youtube videos in a collage at Minneapolis Open Mic, a project I’m not yet finished with.

The first step is to implement Youtube Player api and get your play function ready.



var tag = document.createElement('script');
tag.src = "";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function playThis(elem) {
    player = new YT.Player(elem.attr('id'), {
      events: {
        'onReady': function(){player.playVideo(); player.mute();}

This function will play the video of the selected iframe, the elem variable. It will also mute the video. So we want to trigger the play function when the element is in view.


$(window).scroll(function() {
	clearTimeout($.data(this, 'scrollTimer'));
	$.data(this, 'scrollTimer', setTimeout(function() {
		// do something
	}, 250));
function isScrolledIntoView()
			var docViewTop = $(window).scrollTop();
			var docViewBottom = docViewTop + $(window).height();
			var elemTop = $(this).offset().top;
			var elemBottom = elemTop + $(this).height();
			if ((elemBottom <= docViewBottom) && (elemTop >= docViewTop))

What this does is checks to see if the scroll has ended for a quarter of a second. And then triggers a function that goes through all iframes with the class ‘collageYoutube’. It checks if they are visible on the screen and if they are, sends them to the playThis function you have earlier.

Fun little function. I’m currently working on a pause function for this.

IIS 8.5 Send Classic ASP Errors to Browser

I just started running a classic ASP site on IIS 8.5 and couldn’t get it working but wanted to know the error messages.   I was able to get error messages to be sent to the browser with the powershell as follows:

cscript %systemdrive%\inetpub\adminiscripts\adsutil.vbs set w3svc/AspScriptErrorSentToBrowser true

If you don’t have adminscripts installed, you can install them here:

  • Start/(Settings)/Control Panel
  • Set view to “Small icons” or “list” or “classic view”
  • Choose “Programs and features”
  • Click on “Turn Windows features on or off” in the left panel
  • Expand (+) “Internet Information Services”
  • Expand (+) “Web Management Tools”
  • Enable all options, including “IIS Management Scripts and tools”
  • Press OK and let Windows update.

prettyPhoto path variable, repeat

So i’ve noticed when trying to customize the social media section of prettyPhoto many users ran into an error that made the {path} variable not work.

In trying ot solve this i ran into a script that sends that variable to the social media section, but you are not capable of repeating it.

I did a simple fix on a project that allows us to use the {path} variable, as many times as we want in the socialmedia option of prettyPhoto.

Check out my alterations to the open source Pretty Photo script.

The code i added looks like this.

var regex = new RegExp('{path}', 'g');
jnes_link = settings.social_tools.replace(regex, jnes_media);
jnes_social = jnes_link.replace('{title}', jnes_title); 
//if(jnes_title) alert(jnes_title);

New Header Size Twentythirteen WordPress

So we have the new theme for WordPress, twentythirteen. It looks really nice, and definitely fills out some responsive features.

But what if you wanted to change the header image and make it a logo, like so many of us do?

Well it isn’t as easy in twentythirteen, and here is the quick solution I found out.

I still want to shrink this down and will update it if i can.


function twentythirteen_custom_header_setup_custom() {
	$args = array(
		// Text color and image (empty to use none).
		'default-text-color'     => '220e10',
		'default-image'          => '%s/images/headers/circle.png',
		// Set height and width, with a maximum value for the width.
		'height'                 => 166,
		'width'                  => 375,
		// Callbacks for styling the header and the admin preview.
		'wp-head-callback'       => 'twentythirteen_header_style_new',
		'admin-head-callback'    => 'twentythirteen_admin_header_style',
		'admin-preview-callback' => 'twentythirteen_admin_header_image',
	add_theme_support( 'custom-header', $args );
	 * Default custom headers packaged with the theme.
	 * %s is a placeholder for the theme template directory URI.
	register_default_headers( array(
		'circle' => array(
			'url'           => '%s/images/headers/circle.png',
			'thumbnail_url' => '%s/images/headers/circle-thumbnail.png',
			'description'   => _x( 'Circle', 'header image description', 'twentythirteen' )
		'diamond' => array(
			'url'           => '%s/images/headers/diamond.png',
			'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png',
			'description'   => _x( 'Diamond', 'header image description', 'twentythirteen' )
		'star' => array(
			'url'           => '%s/images/headers/star.png',
			'thumbnail_url' => '%s/images/headers/star-thumbnail.png',
			'description'   => _x( 'Star', 'header image description', 'twentythirteen' )
	) );
add_action( 'after_setup_theme', 'twentythirteen_custom_header_setup_custom' );
function twentythirteen_header_style_new() {
	$header_image = get_header_image();
	$text_color   = get_header_textcolor();
	// If no custom options for text are set, let's bail.
	if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
	// If we get this far, we have custom styles.
	<style type="text/css" id="twentythirteen-header-css">
		if ( ! empty( $header_image ) ) :
		.site-header {
			background: url(<?php header_image(); ?>) no-repeat scroll top;
		// Has the text been hidden?
		if ( ! display_header_text() ) :
		.site-description {
			position: absolute;
			clip: rect(1px 1px 1px 1px); /* IE7 */
			clip: rect(1px, 1px, 1px, 1px);
			if ( empty( $header_image ) ) :
		.site-header .home-link {
			min-height: 0;
		// If the user has set a custom color for the text, use that.
		elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) :
		.site-description {
			color: #<?php echo esc_attr( $text_color ); ?>;
	<?php endif; ?>


Enter that into your functions.php file and it should change the image width and height to the ones specified in the code.

WordPress Taxonomy Bug

So I was making a site that had to use multiple taxonomies for different post types. I love using Custom Post Type UI for these kinds of things. But I noticed what seems to be a bug, or at least a very big pain, in taxonomies.

This translates to all taxonomies no matter if you are using a plugin, or creating them in the functions.php file.

The taxonomy bug does not allow you to use Capital letters, or spaces in the names of your taxonomies. In any way.

If you’ve noticed Taxonomies not showing up in the page settings, for example something that looks like this:

Screen Shot 2013-08-02 at 10.02.57 AM


This is a tell tale sign that you are experiencing this error. If you see this, do the following.

  1. Remove your taxonomy.
  2. Re-create your taxonomy with no capital letters and no spaces.
  3. Should be fixed.

This is still a rather new bug that I’ve noticed, so leave comments if you see anything else strange with taxonomies.

Twitter Widget Pro and the new API

So Twitter dropped support for previous api’s in order to move everyone to an oAuth api of their own. The work to develop support on your own could be a bit extensive, but that’s ok. because I will walk you through how to do it with Twitter Widget Pro.

Let’s skip the download and authenticate parts and get straight to it.

  • Your widget settings are under the settings tab, the link that says Twitter Widget Pro. 
  • You’ll notice two new messages, click “set up your Twitter app keys”.
  • Click the “Add new twitter app” link in a new tab.
  • Sign in. Fill out all required information.
  • Fill out a callback URL as the site URL for the site you want to put your twitter feed on. This is important.
  • Put your consumer keys and consumer secret hashes on your wordpress plugin settings.
  • Update Options at the bottom of the page.
  • Authorize your app.
  • You’re DONE!

This is the basic easy way to get a twitter feed on your site using Twitter Widget Pro.

Create WordPress Posts with Formidable

So lets talk about allowing people to create posts through Formidable Pro on WordPress. You might need to do this for simple discussion forums when you don’t want to host and support all the functionality of BuddyPress. So lets use the simple functionality that Formidable Pro allows.

It’s as simple as this.

  1. Download Formidable as a plugin
  2. Go to “Global Settings” on your Formidable Tab and upgrade to Pro with your username and password.
  3. Allow Formidable to completely upgrade and re-activate.
  4. Create a form with a Topic field, a Content field and an optional Category field.
  5. Go to settings and click the “create posts” side tab.
  6. Create a post and allow your fields to correctly line up

It’s that simple!

You might also want to play around with Custom Post Type UI which will allow you to make a post called Forum or Discussion and have more control over that content.

You might also want to have those pages on secure for only logged in users, requiring people to be a member of your site before posting.