function wpd_add_deals(){
add_rewrite_endpoint( 'deals', EP_PERMALINK );
}
add_action( 'init', 'wpd_add_deals' );
add_filter('request', function($vars) {
if (isset($vars['deals'])) {
$vars['deals'] = true;
}
return $vars;
});
add_filter('template_include', function($template) {
if (is_singular() && get_query_var('deals')) {
$post = get_queried_object();
return locate_template(['my-template.php']);
}
return $template;
});
]]>Can i use some filter of yours plugin to fill vars in shortcode ?
]]>The docs says [pass vars]{ANY_NAME}[/pass] but I need to pass it to the loop.
i.e. [loop type=company, author=this][set co_id][field id][/set][/loop]
[pass vars=co_id]
[loop type=company, field=’id’ value={CO_ID}]
do something here
[/loop]
[/pass]
what would be the correct syntax?
We have made a small plugin based on the works of Endo Creative, which creates a CSV wit all products and their variations. (see the link)
We have successfully been able to show one price in line 121 of the link supplied, however we need to display all the manual prices (DKK and EURO) we entered for all the products and variations aswell, and like I stated we have only been able to show one of the prices, is there some special array or var we can access in the WP_query that will list all the prices?
]]>
var words = [];
words[1]="hello";
words[2]="goodbye";
document.getElementById("mainBox").innerHTML = "<center><h1>"+words[1]+"</h1></center>";
the result is words[1] rather then hello. bellow is the actual code
var galleryImg=[];
alert("hi");
galleryImg[1]="https://www.alisonfriedman.com/wp-content/uploads/2017/07/Fashionshow-3.jpg";
galleryImg[2]="https://www.alisonfriedman.com/wp-content/uploads/2016/07/Fashionshow.jpg";
galleryImg[3]="https://www.alisonfriedman.com/wp-content/uploads/2017/07/Natasha.jpg";
galleryImg[4]="https://www.alisonfriedman.com/wp-content/uploads/2017/07/SabaGino.jpg";
galleryImg[5]="https://www.alisonfriedman.com/wp-content/uploads/2017/08/DianaAndGino-1.jpg";
galleryImg[6]="https://www.alisonfriedman.com/wp-content/uploads/2016/07/MarleneHome-6.jpg";
galleryImg[7]="https://www.alisonfriedman.com/wp-content/uploads/2017/08/MarleneHome.jpg";
galleryImg[8]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_2016.jpg";
galleryImg[9]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_2019.jpg";
galleryImg[10]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/MarleneHome-5.jpg";
galleryImg[11]="https://www.alisonfriedman.com/wp-content/uploads/2017/08/MarleneHome-2.jpg";
galleryImg[12]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_2011.jpg";
galleryImg[13]="https://www.alisonfriedman.com/wp-content/uploads/2016/08/IMG_2007.jpg";
galleryImg[14]="https://www.alisonfriedman.com/wp-content/uploads/2014/12/MarleneHome-1.jpg";
galleryImg[15]="https://www.alisonfriedman.com/wp-content/uploads/2014/12/MarleneHome-4.jpg";
galleryImg[16]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_2009.jpg";
galleryImg[17]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1981.jpg";
galleryImg[18]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1982.jpg";
galleryImg[19]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1983-1.jpg";
galleryImg[20]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1984-1.jpg";
galleryImg[21]="https://www.alisonfriedman.com/wp-content/uploads/2017/08/MG_9939-2-web.jpg";
galleryImg[22]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1178.jpg";
galleryImg[23]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_1176.jpg";
galleryImg[24]="https://www.alisonfriedman.com/wp-content/uploads/2017/07/IMG_2104.jpg";
galleryImg[25]="https://www.alisonfriedman.com/wp-content/uploads/2017/08/IMG_2108.jpg";
galleryImg[26]="https://www.alisonfriedman.com/wp-content/uploads/2016/06/IMG_2111.jpg";
alert("hi2");
var numImg=26;
var imgNum;
var viewerSet;
var tnImg = [];
tnImg[1]=galleryImg[1];
tnImg[2]=galleryImg[2];
tnImg[3]=galleryImg[3];
tnImg[4]=galleryImg[4];
tnImg[5]=galleryImg[5];
tnImg[6]=galleryImg[6];
tnImg[7]=galleryImg[7];
tnImg[8]=galleryImg[8];
alert(tnImg[1]);
document.getElementById("thumbnail1").innerhtml="<img src='https://www.alisonfriedman.com/wp-content/uploads/2017/07/Fashionshow-3.jpg' class='mainImg'>";
document.getElementById("thumbnail2").innerhtml="<img src='"+tnImg[2]+"' class='mainImg'>";
document.getElementById("thumbnail3").innerhtml="<img src='"+tnImg[3]+"' class='mainImg'>";
document.getElementById("thumbnail4").innerhtml="<img src='"+tnImg[4]+"' class='mainImg'>";
document.getElementById("thumbnail5").innerhtml="<img src='"+tnImg[5]+"' class='mainImg'>";
document.getElementById("thumbnail6").innerhtml="<img src='"+tnImg[6]+"' class='mainImg'>";
document.getElementById("thumbnail7").innerhtml="<img src='"+tnImg[7]+"' class='mainImg'>";
document.getElementById("thumbnail8").innerhtml="<img src='"+tnImg[8]+"' class='mainImg'>";
function imgView1() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[1]+"' class='mainImg'>";
}
function imgView2() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[2]+"' class='mainImg'>";
}
function imgView3() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[3]+"' class='mainImg'>";
}
function imgView4() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[4]+"' class='mainImg'>";
}
function imgView5() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[5]+"' class='mainImg'>";
}
function imgView6() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[6]+"' class='mainImg'>";
}
function imgView7() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[7]+"' class='mainImg'>";
}
function imgView8() {
document.getelementbyid("imgLRG").innerhtml="<img src='"+tnImg[8]+"' class='mainImg'>";
}
any help on why this is happening will be much appreciated
Christopher J. Crandall
I have a form which upon success displays a paypal button, and I would like to be able to fill the button’s form with the variables from the form.
It seems to me that it used to work (the form was designed more than a year ago, but rarely gets used).
Is there any option to activate to allow the success message (cforms_success) to be processed for variable replacement ?
Regards,
Chris
https://www.ads-software.com/plugins/cforms2/
]]>in my theme’s functions.php I use
function add_custom_query_vars($vars) {
$vars[] = "tdhm";
$vars[] = "tdht";
return $vars;
}
add_filter('query_vars', 'add_custom_query_vars');
to register the two custom vars “tdhm” and “tdht”.
When I try to access them lateron fromn my page’s template
if(isset($wp_query->query_vars['tdhm'])) {
$email = urldecode($wp_query->query_vars['tdhm']);
}
if(isset($wp_query->query_vars['tdht'])) {
$token = urldecode($wp_query->query_vars['tdht']);
}
they are always empty.
I looked up the results of var_dump($wp_query->query_vars);
and they are nowhere to be found. What am I doing wrong? I could not find anything on this issue within Codex and I have used this function before in other WordPress versions without any problems.
Best regards, Mathias
]]>You are approaching the post variable limit imposed by your server configuration. Exceeding this limit may automatically delete menu items when you save. Please increase your max_input_vars directive in php.ini. More information
max_input_vars :: 1000
Menu Item Post variable count on last save :: 859
Approximate remaining menu items :: 9
Loaded configuration file: /web/conf/php5.ini
I have followed the instructions here.
I changed the php.ini in the web root. But if you look at the yellow box with the text it mentions something called php5.ini which even GoDaddy couldn’t help me find.
I don’t completely know what I am dealing with here and a lot of the help I have seen online has been a little confusing. I tried the thing I read to do and it didn’t work. I read somewhere on here to add this same type of jargon to the htaccess file or something, but all that did is shut down my site.
This is urgent. I need to add new menu items. All I need is to figure out how to increase this max vars thing.
]]>Want something pretty simple, basically wanna redirect every page to the index.php so i can dynamically load it there. So added this to my function.php
add_filter('rewrite_rules_array', 'slug_rewrite_rules_flush');
function slug_rewrite_rules_flush($rules) {
$newrules = array();
$new_rules['(.*)/?$'] = 'index.php?test=test';
return $new_rules+$rules;
}
No problem, worked fine. However, I also want to be able to use the test variable I’m sending along. So added a query_vars hook.
add_filter('query_vars','slug_rewrite_vars');
function slug_rewrite_vars($vars) {
$vars[] = 'test';
return $vars;
}
Problem is that when I add this, I get a totally white page, not errors, nothing. When I change ‘test’ inside the slug_rewrite_vars function to anything not related to test. So for example:
add_filter('query_vars','slug_rewrite_vars');
function slug_rewrite_vars($vars) {
$vars[] = 'ChangedThisVariable';
return $vars;
}
…then it works again, but of course I cannot $_GET the test variable. Anyone knows what I’m doing wrong?
]]>