Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Thursday, November 27, 2014

Show Featured Image After Shareaholic - WordPress

Placing a featured image before the first content paragraph but after the Shareaholic social sharing links plugin. This is pretty simple, but just in case someone needed a quick solution, here is the code. In my case, my theme didn't support this, and I created a child theme so I could update without overwriting my custom changes. It's always smart...
read more...

Thursday, May 1, 2014

Edge.js Brings Node.js and .Net Together

Great article from Scott Hanselman on Edge.js bringing Node.js and .Net together on three different platforms; Mac, Windows, Linu...
read more...

Monday, April 14, 2014

Top 20 Replies By Programmers When Their Programs Don't Work

We can laugh at ourselves right? I've given a few of these over the year...
read more...

Saturday, March 29, 2014

Adding A Fixed Utility Bar To WordPress Genesis Theme

I wanted to add a new utility bar at the top of my site that was fixed. Using Carrie Dils example with a small modification, I achieved what I wanted. Thanks Carrie.Here are the additions I added:style.css.utility-bar {background-color: #4cbb17;border-bottom: 1px solid #ddd;color: #ddd;font-size: 12px;font-size: 1.2rem;padding: 10px 0;padding: 1rem;position: fixed; width: 100%; line-height: .5 !important; z-index: 1;}And I had to make a small change to padding for the @media areas so the title had some distance between the...
read more...

Thursday, March 13, 2014

WordPress WP_Query Sorting On Meta Values

I recently needed to sort posts by values saved in a meta value field. The normal post object only has a reference to the meta values so I needed to figure out how to add a meta key, meta value, and direction to WP_Query. Here is what I did:The meta key: event-detailsThe meta value: a:1:{i:0;a:7:{s:16:"event-start-date";s:10:"03-04-2014";s:14:"event-location";s:15:"Someplace, USA";s:10:"event-logo";s:4:"4301";s:10:"event-type";s:5:"Event";s:10:"event-link";s:36:"http://www.company.com/";s:10:"event-time";s:0:"";s:14:"event-end-date";s:10:"03-05-2014";}}The...
read more...

Tuesday, February 25, 2014

Adding A WordPress Category To Imported Posts

One feature I've either missed over the years or doesn't exist, is the ability to add more meta data to imported posts. Here is the scenario:New WordPress siteImporting old WordPress content into new siteWant to add a new category to all posts (or tag)User custom template page to display new posts (category-foo.php)So how do we solve this issue? Here is what I did. This may not be the best or optimum way, and as a disclaimer, unless you fully understand databases, sql syntax, and how WordPress ties posts and meta data, this...
read more...

Tuesday, February 26, 2013

Want To Be Cool? Learn To Code

If you want to be like the big kids these days, it might make sense to spend some time learning how to code.What most schools don't teach.http://youtu.be/nKIu9yen5nc Photo found he...
read more...

Wednesday, March 28, 2012

Revealing Your Code

Checking out in Walmart the other day I noticed this on the screen in front of me. A console output left in by a programmer? A debug output oops? It has no value to the user....
read more...

Wednesday, March 9, 2011

Required And Optional Function Parameters

I love using different programming languages. Whether it's C#, PHP, Python or Ruby on Rails, they each have their strengths, which makes finishing projects faster. Choose the best tool for the problem.Today a project I'm working on required an additional parameter to a  Javascript method that was already called in several files. In C# I could write an overload methodUse Overloading in C# versions below 4[csharp]public void MyFunctionA (int par1, int par2){ //some code}public void MyFunctionA (int par1, int par2, string...
read more...

Wednesday, March 2, 2011

Popup Video On Page Load

First let me say, there are probably a million ways to do this, and probably 99% of them are the right way, including my way.Site: WordPress. The need: Pop up a video using Lighbox for a registered user. Record the video was shown to the user. Record in usermeta table. Don't show it again on subsequent visits. And lastly, make sure the video only plays on the Home page. This file contains bidirectional Unicode text that may be interpreted or compiled differently...
read more...

Wednesday, August 5, 2009

Easy Way Detect Changes On The Clipboard With Windows API

A recent Windows Forms project required that I copy data from a grid and an associated object with each cell copied. This allows a user to paste the data in the same grid but in a different set of cells. My problem came when a user would copy data from an external application like Excel, and tries to copy the text into my grid. I had to come up with a way to determine the user was trying to paste something copied from an external program. There is a great solution using a Windows API called GetClipboardSequenceNumber(). ...
read more...

Tuesday, June 16, 2009

Today I Learned About WordPress Category Templates

Today I learned about category templates in WordPress. There is a simple, yet rarely used feature, that allows you to display content based on a specific category. For example, if you have 10 categories, with ID’s 1-10, and you want to show your visitors something different for each of these 10 categories, you can create files with this naming convention: category-1.php, category-2.php, and so on. When the URL http://mydomain.com/category/coolcat is entered into the browsers address bar, and WordPress sees a category request...
read more...
 
Copyright © 2003 - 2014 Thom Allen Weblog • All Rights Reserved.