We have thousands of custom posts where we need to update the_excerpt using this PHP snippet (which works great when a single post is saved). Is there a way to tweak this code so that we can run it one time (like when we load a page) and then delete it? We’re trying to update each post’s excerpt b…
Tag: wordpress
Disable add to cart button via custom checkbox in WooCommerce product settings
We want to prevent add to cart for certain upcoming products. We want to have a checkbox to select the specific product on which we want to prevent add to cart. We have right now the checkbox and save code. I also found this: Remove add cart button in Woocommerce for a specific product category and https://wi…
Allows decimal float numbers in WooCommerce form field type number
I am making an input form in WooCommerce using a function called woocommerce_form_field() for an input type number field like below: Now I would like to be able to allow decimal float numbers to be inputed in this field. Is it possible? What should I do? Answer You need to use ‘custom_attributes’ …
Attempting something new in WP. Issue resetting WP loop
Im working in WP and basically what I’ve got set up is some logic to create a separate carousel for each category of my blog. For each carousel im displaying the top viewed posts for each category. Each Item in the carousel has a post thumbnail, author name and author avatar. My problem(if you scroll do…
Change product status Woocommerce in short description field
I put product status and other info in short description field on wp all import for all products like this: avaliable I want if product category is Videocards to change product status and icon to “call” insted of “avaliable” like this: call Any way to do this with custom function in wp…
foogallery php shortcode with ID taken from AFC custom field variable does no display
I have ACF custom field in posts with the gallery ID. The custom field is stored in wp_postmeta table. I am trying to execute shortcode on post page with the gallery id assigned to this post. my code: returns “The gallery was not found!” How to execute the shortcode ont the post page with the ACF …
Change order item custom meta data displayed label and value in WooCommerce Admin orders
In the Woocommerce admin screen, I’m attempting to use the order line meta data to display a button which will open up a new window with the URL of the dropship supplier. I have successfully pulled the supplier URL from the product on order and pushed it to the order line item. I am able to change the m…
Adding Custom Footer to page Template
I have made a custom footer layout using “dummy” content to start with. This is the footer html To get this to display on the bottom of my last “scrolling section” (#contact) I have added this html footer to : page-templates/template-full-page.php However my footer is not displaying at…
Empty cart button on woocommerce cart page does not work properly
I’m using this code to creare a button on my woocommerce cart page (near the update cart button): The problem is that it works only by clicking two times. I think that the problem could be that I’m using this link to add a product to the cart: Any idea how to solve this? Answer The problem lies in…
How to hide specific elements in General Settings
There’s any way to hide these elements? I only want to keep “Site Title” and “Tagline” two fields in General Settings page. like that Answer There is no filter to hide disable the fields, you can hide the fields using css but they are still there. you can add this to your themes …