This is similar to How to add data- attribute to <body> tag but different in that I am n ow searching for a solution that does not require modifications to the template file.
I ha
I'm using a theme-specific, custom hook to add some custom attributes/values to the page's <body> element. There are however pages on my site that use a template that do not have that hook available and for certain reasons, I cannot modify that template or create a custom versi
I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments')
I have 2 pages that are identical in my dev and production environments (http://wordpress-310389-952347.cloudwaysapps.com/2020/08/17/benelinx-qa/ and h
So, wp_localize_script() are awesome to add custom data to a script. And these data gets added to the HTML like:
<script id='woocommerce_some-js-extra' type="text/javascript">
var wc_some_params = {"key":"sdfsfsdfs","use_iframes":"1","images_dir":"https://dadadas
I'm learning JavaScript and React so I can possibly create my own image block via a plugin that supports multiple image uploads. Are multiple image uploads within a custom image block even possible with WordPress?
I would also like to know if you can group individual .jpg images that I hav
I am trying to take my existing object array then json_encode it and add it to a $_SESSION[''] so I can request it on other pages on my website. Is there a way to save my session string (or array) and display it on another page?
Below is the code of the array I am trying to add into a sess
I have a plugin that hides certain posts in the frontend. For this to be consistent, I need posts to also be hidden in searches and AJAX searches (needs to work with any theme and search).
To make this work with AJAX search, I am using:
if ( wp_doing_ajax() ){
add_action
A customer wants some specific/bespoke discounts to the subscription service they sell. I cannot find a plugin to do what they want, so thought I would code it myself.
But I cannot find how to edit the initial payment item in the cart for subscriptions.
Using woocommerce_before_
I found that init hook is being called twice and then I try to trace and find out wp-settings.php is also being called twice. I originally want to post a question to find out why. And after some code injection tests. I found out the reason and would like to share here and see if ther