0
votes
1answer
31 views

Passing variables from header.php to template and vice verca

I've defined a variable - let's call it $header_var, which is placed in the header.php file. I would like this variable to be passed onto my template file (in this case taxonomy.php). Also I would ...
0
votes
1answer
51 views

Current URL path variable

WordPress has a built-in variable $pagename that will give the current page. I am looking for something that will give the full url including the path before the current page. Details below. I am ...
0
votes
0answers
98 views

global variable not accessable inside functions

I downloaded and installed a wordpress plugin. Everthing works fine on localhost untill i uploaded the site on live server it wasn't working as intended. When i define a variable as global its value ...
0
votes
1answer
471 views

No access to global variables?

In main.js, I have a script, which is sending an ajax request to script.php. $.ajax({ type: "POST", url: "wp-content/themes/roots/script.php", data: registerdata, success: ...
0
votes
2answers
5k views

How to set global variable in functions.php

I want to be able to echo the URL of the featured image of a post and after looking some on the web I found the following which works fine when I put it in a loop in my front page template. <?php ...
1
vote
2answers
250 views

Retrieve the template directory URI via global or get_template_directory_uri() every time?

One Wordpress function I happen to use frequently is get_template_directory_uri(). While I tried to minimize or avoid its use where I can, I still happen to have more than one call to this function in ...
-2
votes
1answer
357 views

How do I access variables outside a function [closed]

I have a custom function which defines a bunch of variables. I would like to be able to call this function from inside a loop so I can have access to all its variables, like so: functions.php ...
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
1answer
815 views

What does the Global Variable $s represent?

What does the $GLOBALS['s'] variable contain? It looks like an empty array, but what would it normally hold? I've encountered it in a tutorial: The WordPress Theme: Single Post, Post Attachment, ...
0
votes
1answer
468 views

SFTP define in wp-config.php

just wondering if theres a way to define sftp info in wp-config.php the same way you can with ftp. makes plugin adding a lot easier! best,Dan.
0
votes
2answers
3k views

Get current page id, title, url, etc

Sorry but I get lost on Wordpress's codex. I am trying to add a mail this page sharing link and want to include some info from the page. In pseudo code is this possible? <a ...