Everybody hello! I’m sorry for asking such kind easy question, I’m pretty new at this. I have problem with transfering parameter value and echoing it to itself. PHP code snippet on page: [xyz-ips snippet=”Generating-content” paramSet=”1″] Inside ‘generating content’: Right now I need to change condition if($sub_value == 1) to if($sub_value == “PARAMETER VALUE”) Please help, guys! Answer Thank you guys
Tag: code-snippets
Woocommerce $product class can’t be accessed inside PHP snippet
I’m trying to write a PHP code for showing extra fields on my product page with “Woody Snippets” in WordPress. But I can’t access the $product class inside my snippet. Is it not possible or am I doing something wrong? Here is my code: Answer I realized the cause of the problem is my theme. My theme uses templates for
Disable Right Click on WordPress Site
I wanted to disable right click on my wordpress site. I have written a small snippet and inserted into body which disables right click, CTRL events and keyups. but it is annoying when I want to copy something on site. is there a way I can modify the current snippet like only logged in users would be able to access
How can I keep an HTML snippet in a separate file, plug variables in as needed, and echo it out on demand?
For instance, let’s say I have a snippet of code, which I’d like to keep separate. for now, we’ll call it snippet.php. snippet.php would be a simple block of reusable HTML which would have php variables in it. Something like this: I’d like to be able to return this code from a function, along the lines of this: I know