Tag Archive for 'PHP'

aStore into K2 theme on WordPress

Wha? If you have an Amazon Associates account, you can create a little store. If people buy from that, then you get PAID! That’s what the g-units want isn’t it? To get paid?

SO… You will have to search the web for tips on how to set up and customize your store but here’s how I made it look nice in my K2 powered blog over at Kulcha.

First thing, I got the inline frame code for my store and it looked horrible… about 2 inches wide and scrollbars everywhere!

Next, I created a template in my theme which would elminate the sidebar:

  • Take page.php & add template php code to the top e.g., <?php/*Template Name: No Sidebar*/?>
  • Remove the <? php get_sidebar(); ?> from near the end of it
  • Save this as pagenosidebar.php and upload to theme directory
  • Create a css class to increase the width of your primary div (I put it in the css of my custom K2 style)

After that, I had to edit the css of my aStore. (That sounds dirty huh?)
I just trimmed the margin of the body div from 24px to a lovely 5px.

Passing PHP variables to Javascript

I had a simple problem. I wanted to pass a single variable from the PHP Server to some Javascript code.
In the top of my page I set the variable:
$myVar = $_SERVER['PHP_SELF'];
?>

Then I just call my php function and pass it that variable as an argument.
But…
I have to use PHP to echo back the value.
myJscriptFunction('<?php echo $myVar; ?>');

Team

 

Will Brown – Team Lead, Maintenance Crew
   (and everything else at the moment…)