Shields up, Red Alert

WordPress Tip #1 : Custom Scripts, AJAX Calls, Limitless Shoddy Code …

Coding custom AJAX/PHP scripts in your Wordpress theme

  July 2nd, 2014


So you have a WordPress site and you need to save some information from the front-end, count likes, custom analytic, shit I dunno.

There comes a time in every person’s CMS career where you start realising that installing more and more plugins just causes more and more headaches, so you go in search of the coding tricks that will last more then a few core updates.

The first problem one has trying to write their own custom scripts is that you want to access the WordPress database. So you create a custom php file, include some random WordPress files till you get a connection. You know it looks ugly, but how the hell else are ya suppose to do it?

Well for one you could just go here and read up on it: WordPress Codex

But I’m gonna help you out, here it is.

First up, we need to create a function in wordpress. This will be your script. Write in it whatever the hell you want. Update a meta field (Custom Field) or return a set of results in json format. Its up to you.

The PHP: functions.php

The Javascript:

Note: If your javascript is having trouble change ajaxurl to “/wp-admin/admin-ajax.php”

Have fun storming the castle.

By: Jason Rogers   •      No Comments Yet

  javascript php tips wordpress

Ranked on Goodreads is a Great Feeling!

  February 6th, 2014


Awe I feel great after seeing this! Im not so involved in the community, but I read up everyday on goodreads!


 

By: Jason Rogers   •      No Comments Yet

  books inspiration personal stuffs

A Misunderstood Life

High school was a real treat i’ll gladly not repeat

  January 12th, 2014


If you struggle with the intricacies of everyday life, watch this.

 

The One Book

8520610

I read Susan’s book some months ago, and it was/is the only book to ever capture any resemblance to who I am. Which is sad because I know I’m not alone.

In a way, as corny as it sounds, it started me on a path to accepting my true nature. How can that be bad?

My favorite section was actually close to the beginning where she made a reference to studies done from last century to this century about what qualities the books of their time were eliciting:

Pre 1920’s Post 1920’s
1 Citizenship 1 Magnetic
2 Duty 2 Fascination
3 Work 3 Stunning
4 Golden Deeds 4 Attractive
5 Honor 5 Glowing
6 Reputation 6 Dominant
7 Morals 7 Forceful
8 Manners 8 Energetic
9 Integrity -

This is when I became hooked. A slight case of the grass greener, perhaps?

Me

“You are the average of the five people you spend the most time with.” Jim Rohn

I think perhaps in my case I was the product of the intolerance and miscommunication of opinions of said 5 [not the same 5 at all times mind you]. I almost used bigotry, however I do not intend people to think I am writing to slander them. I think people have given this word special meaning that turns it derogatory (or im wrong and it is derogatory…sorry).

big·ot·ry – intolerance toward those who hold different opinions from oneself.

Not void of friendship, but not from understanding either. It was not until recently, maybe the last two years, that I have learned enough to cast aside the will of what society makes of me, and to redefine myself. Trust me its been a sometimes lonely, medicated, constant search of a journey. And that’s ok. It’s much better now.

Oh and for your reference, seeking solitude and being alone are two different things. Next time you see someone alone maybe its not out of loneliness or some pejorative dissent…

The Apology

Just as I have been judged, so too did I cast it. Being misunderstood brought about frustration and anger that would lead to unspeakable insults (in both directions). What kind of friendship is that?

Instead of learning and trying to understand I would hide away from dealing about situations. And so I apologize for my failure of forthcomings.

Watch the TED talk, read the book. Maybe society will seem just a little more cozy.

By: Jason Rogers   •      No Comments Yet

  authors books inspiration opinions personal stuffs

Alan Watts (1915 – 1973)

What if Money Was No Object?

  January 6th, 2014


“The ego is nothing other than the focus of conscious attention.

97182-alan-watts-1024x640

Alan Watts (6 January 1915 – 16 November 1973) Taught Eastern philosophy to the Western Culture. He wrote The Way of Zen in 1957, one of the first bestselling books on Buddhism. As well as over 25 other books.

If you haven’t seen this video, then you should. One of my favorite inspirational speeches.

 
The Script:

“So I always ask the question: What would you like to do if money were no object? How would you really enjoy spending your life? Well it’s so amazing as the result of our kind of educational system, crowds of students say ‘Well, we’d like to be painters, we’d like to be poets, we’d like to be writers’ But as everybody knows you can’t earn any money that way! Another person says ‘Well I’d like to live an out-of-door’s life and ride horses.’ I said ‘You wanna teach in a riding school?’

Let’s go through with it. What do you want to do? When we finally got down to something which the individual says he really wants to do I will say to him ‘You do that! And forget the money!’ Because if you say that getting the money is the most important thing you will spend your life completely wasting your time! You’ll be doing things you don’t like doing in order to go on living – that is to go on doing things you don’t like doing! Which is stupid! Better to have a short life that is full of which you like doing then a long life spent in a miserable way. And after all, if you do really like what you are doing – it doesn’t really matter what it is – you can eventually become a master of it. It’s the only way of becoming the master of something, to be really with it. And then you will be able to get a good fee for whatever it is. So don’t worry too much, somebody is interested in everything. Anything you can be interested in, you’ll find others who are.

But it’s absolutely stupid to spend your time doing things you don’t like in order to go on spending things you don’t like, doing things you don’t like and to teach our children to follow the same track. See, what we are doing is we are bringing up children and educating to live the same sort of lifes we are living. In order they may justify themselves and find satisfaction in life by bringing up their children to bring up their children to do the same thing. So it’s all retch and no vomit – it never gets there! And so therefore it’s so important to consider this question:

What do I desire?”

Alan Watts

…and that beard was just so sexy!

By: Jason Rogers   •      No Comments Yet

  authors birthdays inspiration money

2014 New Years Resolutions

and a little video of my new years night

  January 3rd, 2014


This is how I spent New Years in Hamburg Germany. Was quite the experience, and will not soon forget.

Spectacular show albeit a little frightening with the craziness. Where im from you definitely cant buy fireworks like the shit they sell at the local k-mart equivalent.

The choice of no new years resolutions

Watched a video by a google guy, Matt Cutts. Found him years ago while doing SEO work at my previous employer. I tend to check up on him once in a while, see what he has to say and what not. Anywho he did a TED talk, and he talked majorly about 30 day tryouts for new things. It has sparked a interest in me. So maybe ill have monthly resolutions. But I really am looking for a noncommittal no pressure yet productive year.

until…

I saw this crap plastered onto my Goodreads account, and that little beautiful square just enticed me to put a number there…Verdammt!

Goodreads___2014_Reading_Challenge

Last years goal was 30, and I ended up reading 45. However at around 27 I was getting very anxious and nervous and the prospect of finishing was giving me jitters. Then I finished it like 3 months ahead of schedule so I’m not sure what the hell my deal was. I think ill keep it simple and put 25 this year. Easy number, and gives me time to maybe do some other stuff I’ve been hoping to get into.

Heres a list of things that I’ll give myself permission to do, but not beat myself over not doing.

1. Exercise
2. Drink tea on a very regular basis
3. Get a rock climbing membership—guess that could go hand in hand with exercise
4. Write weekly here about whatever the hell strikes, anything

By: Jason Rogers   •      No Comments Yet

  personal stuffs