I have been trying to learn PHP, and I am stuck at one point. I created some posts and made them as links, but on clicking them, they lead me to a blank page. Here is the index.php code Here is the single.php code I changed the href value to another working link, and it was working pretty well, the
Tag: wordpress
Woocommerce separate title and variation from mini cart
This is html output of mini cart product item, I need to separate title and variation something like this: But I edit mini-cart.php and find this code: And there is wp_kses_post to generate this title, but I don’t know how to add some html to it? Answer Simply clone and override mini-cart.php in your theme then, find this line: Append:
Woocommerce custom redirection based on purchased multiple products after payment
I use wooCommerce theme and this my working redirect after checkout per product code : Now i want code working for multiple products like : Any help with this to apply for multiple products please. Answer The easiest way to achieve this with as little modification to your working code as possible would be to use in_array(). Also, please note
Get parameter of shortcode in Insert PHP Code Snippet plugin using ACF repeater
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
Navigating links within custom WordPress plugin
I have created a custom WordPress plugin that will display a list of information and i will have the ability to add or edit this information. This seems easy but somehow i am not able to make it work how i would like it to. I have a list of companys and i am showing this list in a table.
How to call a PHP cURL function in a WordPress website
I have a need to call the REST API with GET request in my wordpress website. The requirement is whenever we search any product from the search form, the PHP curl function should give the response. The PHP function I have already implemented as below: I’m new to PHP and all this web development. I’m doing this stuff because I
WordPress functions.php custom code – I don’t see error, but no render of content on frontend
I really need help with this code, because can’t figure out why isn’t working and even does not have syntax error, content is not rendered on frontend, at all. I created quiz blocks with questions and answers. Now I want to show mixed types of ads after certain number of questions. Sample code below: Idea is to count question blocks,
Getting Post Thumbnail to show for Single Post Obect (WP + ACF)
I am having a hard time getting the Wordpress thumbnail to show up when I am using Advanced Custom Fields Pro Post Object. My goal is to have the user select a single featured post to show up after the 6th post on the blog page. This is my code (which is pretty much directly from ACF documentation): This returns
How to pass php variable to html template from Database in WordPress
I’m making my own WP plugin, which has a text field containing some template, which I save to the database (table=templates, field=template), something like this: Then I’m trying to show a message to a user: And it is output “Hello {$user_name}” instead of “Hello Bob” I can not get how to pass PHP variables to HTML throw the database. I’ll
Redirect user to other website on when clicked on Add To Cart button
I need help in finding the correct hook for WooCommerce. I’m trying to integrate design-builder API with the WooCommerce store. I have to make a redirect to the builder’s website when a customer clicks “Add To Cart” on the product page. Example URL I need redirect to: https://exampleurl.com/designBuilder/{UniqueID} {UniqueID} is generated with this: Is there a WooCommerce hook to change