get_var not returning a value when the field contains an apostrophe
get_var not returning a value when the field contains an apostrophe
get_var not returning a value when the field contains an apostrophe
Is everything I need to code here? If it works then yes! If it does not work then no there is stuff missing. Only you can answer this by opening the site and checking if it does what it’s supposed to do. Is the code missing any WordPress best practices? This is a very open … Read more
I don’t know if that answers your question. But if you have a child theme in FTP, you can go to wp-content -> theme -> The folder of your child theme, here you will find everything you need. Otherwise if you only have a parent theme, you can still create a child theme, but the … Read more
I found the issue, had to edit /etc/php/8.3/cli/php.ini file, by adding/editing following lines : [mail function] ; For Win32 only. ; https://php.net/smtp #SMTP = localhost SMTP = mysmtpserver.domain ; https://php.net/smtp-port smtp_port = 25 username = myusername password = mypassword sendmail_from = [email protected] Then a service nginx restart. I still don’t understand why PHP is able … Read more
you can generate shortcodes and launch them with this function : https://developer.wordpress.org/reference/functions/do_shortcode/ so you can do that in your plugin : add_shortcode(“MY_PLUGIN__forms_with_dates”, function ($atts, $content, $tag) { $atts = shortcode_atts([ “months” => 11, “id_form” => NULL, ], $atts, $tag); if (!isset($atts[“id_form”])) { return “shortcode $tag : the argument id_form is missing.”; } $shortcodes = “”; … Read more
get_the_permalink() returns the permalink as a string and doesn’t echo it. You either need to echo this yourself <?php echo get_the_permalink(); ?> as you’ve got in some of your other <?php tags, or you can use the helper function the_permalink() which does echo <?php the_permalink(); ?> the same pattern as you’ve used for the_title(). Note … Read more
To allow users to add any number of custom user_meta fields on a WordPress front-end page, you can approach this by using JavaScript for dynamic form generation and then handle the form submission with PHP to store the values in user_meta. Here’s how you can achieve this. Create the Front-end Form First, create the HTML … Read more
Turns out to be quite simple in WordPress 6.5. Use wp_register_script_module to register the imports, and include them as dependencies in wp_enqueue_script_module: add_action(‘wp_enqueue_scripts’, ‘enqueue_three_d_script’); function enqueue_three_d_script() { wp_register_script_module( ‘three’, “https://unpkg.com/[email protected]/build/three.module.js”, array(), null ); wp_register_script_module( ‘three/addons/’, “https://unpkg.com/[email protected]/examples/jsm/”, array(), null ); wp_enqueue_script_module( ‘three-d-script’, SCRIPTS_DIR . ‘threeDTest.js’, array(‘three’, ‘three/addons/’), null ); }
Firstly, you should absolutely not modify core files. Ever. Any changes you make to core files can and will be overwritten any time WordPress updates. There are umpteen ways in which WP has been written to allow you to change its behaviour without hacking on core files: hooks, filters, APIs. Use those instead. In this … Read more
If you want to add ?wmc-currency=AUD for all of your product URLs in the sitemap, you can use the wpseo_xml_sitemap_post_url filter: /** * Alters the URL structure for all products * * @param string $url The URL to modify. * @param WP_Post $post The post object. * * @return string The modified URL. */ function … Read more