1
vote
0answers
22 views

How to return Javascript variable to wordpress [duplicate]

I use this Javascript code to create a dialog box to ask some thing to user and after decide what to do depending of the response. function dialogToCont() { var retVal = confirm("Do you want to ...
2
votes
1answer
38 views

How do I know what variables are passed in a filter/action and what their meaning is?

Something I have seen several times now and I don't understand is the following: In a theme's functions.php a function is defined and then attached to a hook, like so (simplified example): function ...
0
votes
0answers
66 views

Create and update Custom Cookie based on multiple GET and POST Values for first time visitors?

I am not exactly sure the most efficient way to write this code. I collect custom data in my forms and also in my url via get such as: Name utm_campaign URL Referrer ID Among many more. Do I ...
0
votes
1answer
21 views

Variable not staying set

This is most likely just a PHP problem, and it's probably a pretty simple answer, but I just can't seem to get my brain to function this morning. This is what I'm trying to do: $job_file = ...
1
vote
2answers
72 views

Putting PHP variables into javascript [duplicate]

I've created a simple theme options page for my site. The options page contains three input fields. I can output the the fields by using get_option. The three fields are called using the following: ...
1
vote
1answer
292 views

How do i calculate the total of values of custom fields in custom post types?

So the title is a bit unclear, but here is what i have: Custom post type: Projects Custom post type: Investments        + Custom field: Amount And i have one page ...
0
votes
1answer
34 views

Difference in Get Variable Location

I have noticed that in some instances in WordPress (such as in my custom post types), GET variables appear as following in the URL: www.url.com/events/cool-event?action=edit&message=1 However, ...
0
votes
0answers
298 views

Pass a variable between WordPress Custom login and BuddyPress registration page

I am coding a custom WordPress template that has to be also BuddyPress compatible. Actually when BuddyPress is Disabled my custom login/registration form works without problems but, as soon as I ...
0
votes
1answer
90 views

Custom Post not working as expected

NEW EDIT I solved it, as written in answer, the problem where that variables are 'forgotten' (not so techy I know, sorry for this) when function starts. EDIT: I found the problem is this: ...
0
votes
0answers
239 views

Use $_GET with permalinks on page

I'm currently trying to use a $_GET to populate a MySQL query with in a URL on another page within a Wordpress site. URL sample: <a href="http://site.com/file.php?alabama">Alabama</a> ...
0
votes
1answer
255 views

How to put a form with php code into a variable or shortcode?

I'm trying to put my frontend form into a variable or a shortcode so I can wrap another shortcode around it (specifically Bainternet Post Creation Limits). My form has PHP code in it so I'm not ...
0
votes
2answers
693 views

Can't get options with $data['variable']

Can't get options with $data['variable']. (I'm use SMOF - Slightly Modded Options Framework) For example in the header.php (index.php, footer.php, etc.): global $data; $logo_type = stripslashes( ...
1
vote
2answers
900 views

How can I Add a variable PHP in the Menu Nav

I want to add a variable in the Menu, for passing a value in all my page. The purpose is to retrieve a value for transport to another web site (from my website links) to the tracking, this value ...
-2
votes
1answer
582 views

Use ajax response in PHP function

Ok, so I'm working on a plugin and just ran into a problem. Here's what I'm doing: 1. Using a metabox with Plupload to upload an image to an upload dir in the plugin folder. 2. Upon upload success a ...
0
votes
1answer
449 views

Apply class to every third list item? [duplicate]

Possible Duplicate: How to mark every 3rd post I'm trying to give a class to every third list item on my page. I know how to give a class to every item, but not to specific items in a row, ...
4
votes
4answers
2k views

Where to get information about array fields in $_REQUEST?

I just started to learn PHP and doing things with WordPress and I am a bit confused about information in Codex. Was told that Codex got all info I required but I got stuck with it. What array fields ...
0
votes
2answers
317 views

persist a variable set in header.php all the way down to footer.php

I look up a custom post field value in header.php, and store it in a global variable. In most of my template files, the includes go like this: include header ...do a bunch of stuff include ...
3
votes
1answer
502 views

Variables declared in header not available in other includes

I have a var set in my header.php file: $myBool = false; and in page.php, I try to echo it: echo $myBool; But the variable is never set. This doesn't help either: global $myBool; echo $myBool; ...
0
votes
1answer
408 views

PHP variables in a post?

I'm very new to PHP. On a Wordpress site, I want to use custom Google Maps with the Javascript API V3. Some posts will have maps in them, and I want to use PHP variables to determine the unique ...
0
votes
2answers
1k views

When would you use $_post instead of $post?

I've seen some examples that use $_post instead of $post. What's the difference and when would you use $_post instead of $post? Example: if (have_posts()) : while (have_posts()) : the_post(); ...
1
vote
4answers
2k views

How to tell if $query_var isset?

I tired to use isset($queryvar) but that didnt work, so I implemented my own function qv_isset, but it runs into a problem when $ch is set to 0. $cls = get_query_var('cls'); $ch = ...
3
votes
1answer
2k views

How do I make my function add variables/values to the $post object?

How do I add $tzDesc and $tzEmbed (and other variables) to the $post object in the following function so that I can display the values in my theme files by inserting <?php echo $tzDesc; ?>? ...
2
votes
3answers
533 views

where to include a php file

I have a php file with some variables which I would like to use. When I include it in the header.php the variables in that file are not recognized at footer.php and some other places. Where is the ...