How To Create a Single Custom Post Type Template for Genesis in WordPress

Author: , October 21st, 2017

wordpress/wp-content/themes/yourTheme/single-yourCPTslug.php 1 2 3 4 5 6 7 8 9 10 11 add_action( ‘genesis_before_entry_content’, ‘display_custom_fields’ ); function display_custom_fields() {     $jobTitle = get_field(’_jobTitle’) ?: ‘-’;     print <<<EOT     <br style="clear:both"/>     <p>Job Title: $jobTitle</p> EOT; }   // Genesis Loop genesis(); add_action( ‘genesis_before_entry_content’, ‘display_custom_fields’ ); function display_custom_fields() { $jobTitle = […]

How To: for loops in bash

Author: , February 27th, 2015

1 2 3 4 #!/bin/bash for line in `cat file.txt`; do    echo line: $line done #!/bin/bash for line in `cat file.txt`; do echo line: $line done 1 2 3 4 #!/bin/bash for file in $( ls ); do    echo filename: $file done #!/bin/bash for file in $( ls ); do echo filename: $file […]

How To Loop Through Objects In JavaScript

Author: , May 15th, 2011

Coming from the Perl world, I wanted to emulate the following code in JavaScript: 1 2 3 4 5 6 7    my $myHash = {       ‘foo’ => ‘Hello’,       ‘bar’ => ‘World’,    };    foreach my $myKey (keys %$myHash) {       print $myKey,’=’,$myHash->{$myKey};    } my […]