
frankdm
Members-
Posts
14 -
Joined
-
Last visited
Everything posted by frankdm
-
Hey, I found the answer, I had to remove the ' icons!
-
Hey it is a number, i think (it is the ID of a product in woocommerce), I have no idea how that is returned, I guess as a number.
-
I adapted it to the best of my abilities, it is not erroring but it is not working either: case 'excerpt': if ($atts['excerpt'] == 'true') { $vargooglelink = "http://www.google.com/images?q="; $varproducttitle = get_the_title(); $vargooglelinkend = " house"; $varbundlecheck = get_the_ID(); if ( !in_array($varbundlecheck, array('5415','5961','4710'), true ) ) { $varcomplete = $vargooglelink . $varproducttitle . $vargooglelinkend; $content .= "<td> <a href='$varcomplete' target=_blank><img src=wp-content/custom/imageicon.png /></a> </td>"; } } break;
-
Hello all, I got a value in a variable (works fine), now I want to check if that value is NOT some things and then do something if it is not, here is what I have so far: (the two lines between the empty lines are the new bit, the other lines are old and work fine) if ($atts['excerpt'] == 'true') { $vargooglelink = "http://www.google.com/images?q="; $varproducttitle = get_the_title(); $vargooglelinkend = " house"; $varbundlecheck = get_the_ID(); IF $varbundlecheck IS NOT 5415 IS NOT 5961 IS NOT 4710 THEN DO $varcomplete = $vargooglelink . $varproducttitle . $vargooglelinkend; $content .= "<td> <a href='$varcomplete' target=_blank><img src=wp-content/custom/imageicon.png /></a> </td>"; } break;
-
I fixed this, for the record, this was the solution: $content .= "<td> <a href='$varcomplete'><img src=wp-content/custom/imageicon.png" alt="imageicon border="0"></a> </td>"; for some reason the " markings needed to be removed (every example on the web had them but removing them worked, go figure
-
Hey all, thank you for all the great help so far, this is my last question about my hyperlink I got this: $content .= "<td> <a href='$varcomplete'>test</a> </td>"; This totally works. However I would like to have a image instead of the word "test". This sounds easy but I can't seem to get it working. (keep getting line errors if I try examples I get from the web).. for example this does not work: $content .= "<td> <a href='$varcomplete'><img src="wp-content/custom/imageicon.png" alt="imageicon" border="0"></a> </td>"; It gives me the error: Parse error: syntax error, unexpected 'wp' (T_STRING)
-
I got the following code: $vargooglelink = "http://www.google.com/search?q="; $varproducttitle = get_the_title(); $varcomplete = $vargooglelink . $varproducttitle; echo $varcomplete; $content .= "<td> <a href=$varcomplete>test</a> </td>"; The echo is just to test, the names in the echo are 100% correct so both variables are filled in as they should. HOWEVER, the $varcomplete only uses the first word of the $varproducttitle in the hyperlink ... again, if i echo &varcomplete or &varproducttitle then in both cases it shows me 100% correct all words.... it is just when I use $varcomplete in the href that it looses any words after the first... I am stumped... I take it has to do with the space between words in &varcomplete (maybe a url doesn't like spaces) but in this case I need those spaces!
-
The author of the plugin tried to help me but either gave up or has connection issues on Skype.. but the last thing he told me to try was this: case 'excerpt': if ($atts['excerpt'] == 'true') { $content .= "<td><a href=\"http://www.google.com/search?q=' . get_the_title() . ' \" target=\"_blank\"><img border=\"0\" alt=\"imagelink\" src=\"wp-content/custom/imageicon.png\"></a></td>"; } break; But this makes the image search for: ' . get_the_title() . ' But it is close i think
-
Thank you for trying to help but I do not know what a IDE is (except a sort of hard drive connection) and my php knowledge is not existant... I need to alter this wordpress plugin (the whole plugin is this one file) and I already contacted the author but he does not reply. It is a old plugin but there is nothing like it so I have to do it myself, but i can't, so i ask for help here.
-
Here is the entire php file www.mediansoft.net/php.zip The error says line 485 is wrong (if it helps you locate the code we are talking about in the php file) Thank you again for the help! I have very, VERY limited php knowledge so while i can copy paste edit things and generally understand what the code is doing, i cannot write it myself
-
Here is a picture showing the code, maybe it helps: http://www.mediansoft.net/helpphp.jpg As you can see, i can already tell by the colors my editor is using something is wrong
-
I tried your edited post like this: case 'excerpt': if ($atts['excerpt'] == 'true') { $content .= "<td><a href='http://www.google.com/search?q=". get_the_title()."'> target="_blank"><img border="0" alt="imagelink" src="wp-content/custom/imageicon.png"></a></td>"; } break; Still a line error
-
Hey I tried this but it gives me a line error again: case 'excerpt': if ($atts['excerpt'] == 'true') { $content .= "<td><a href='http://www.google.com/search?q={get_the_title()}> target="_blank"><img border="0" alt="imagelink" src="wp-content/custom/imageicon.png"></a></td>"; } break; EDIT: I also tried your method 2, also a line error. As it the hyperlink needed to be in the form of a image I also included those parts.
-
I am trying to, in php, add a hyperlink containing a wordpress variable. This is what I got so far: case 'excerpt': if ($atts['excerpt'] == 'true') { $content .= '<td>' <a href="http://www.google.com/search?q=" . get_the_title() . ></a> '</td>'; } break; This is giving me "error on line" errors... If I just use: $content .= '<td>' . get_the_title() . '</td>'; Then I get the post title so that part works... but i need to do a google search with a post title, so i need to add a hyperlink around that: <a href="http://www.google.com/search?q=</a> And this needs to work in the case above. I cannot figure it out