tiago calado
  • Member for 1 year, 1 month
  • Last seen this week
  • portugal
Using WP_Mail on MacOS 12 (Monterey - M1)
Accepted answer
3 votes

Hi I put this function on the functions.php or in a plugin and works for me everywhere, on localhost or in any server. just need to change the strings to your email smtp settings. Only with gmail I ...

View answer
paypal not showing on woocommerce payments
Accepted answer
2 votes

Paypal standard is now hidden for new installs, possible to read about it in https://developer.woocommerce.com/2021/07/12/developer-advisory-paypal-standard-will-be-hidden-on-new-installs/ for those ...

View answer
Remove a category from a post when saving a new post
Accepted answer
2 votes

Your foreach doesnt have brackets or semicolons, probably thatś why. and also not very well idented. Here it is the code properly idented, just one maybe, the foreach closing brackets probably must be ...

View answer
Unstable handling of CSS under WordPress/Elementor
1 votes

this is just css, probably is just browser cache not clean. However your test page website at this date does not have a .offst class and your main site has you said has a inline css and also an id of ...

View answer
Getting rid of unwanted nonSQL syntax characters when debugging a query
1 votes

what you are getting is a sql statement not a sql query result. actually die is a function so should be die(); when using print_r($query); die(); $rows = $wpdb->get_results($query); the second ...

View answer
Order By Post Type ThenBy Taxonomy
1 votes

yes, offcourse it is possible, I had made two websites for selling car pieces myself and that is very possible. anything is possible. you can create your own search results with the file search.php ...

View answer
Different custom templates for product category
1 votes

try to use get_template_part('yourfile') instead. the get_template_part() goes from theme root path. so if you have your template in woocommerce folder use: if( has_term( 'course', 'product_cat' ) ) { ...

View answer
Automatically add product_categories to nav_menu
1 votes

put this on your functions.php and then call the function in whatever page desired. this code is prepare to use css. if (! function_exists('menu_categories')) { function menu_categories(){ $...

View answer
How to edit title on Edit post pages?
Accepted answer
1 votes

Add this code instead on your functions.php, this will change the post and product title to the post or product that is being edit: add_filter('admin_title', 'my_admin_title', 10, 2); function ...

View answer
Remove item in Checkout
1 votes

that function is deprecated, use wc_get_cart_remove_url( $cart_item_key ) instead if (is_checkout()) { $product_name .= apply_filters('woocommerce_cart_item_remove_link', sprintf( '<a ...

View answer
Create a custom display order in the main menu
1 votes

you can get the product categories using the get_terms() and a loop. <?php $cat_args = array( 'orderby' => 'name', 'order' => 'asc', 'hide_empty' => true); $cats = get_terms( 'product_cat',...

View answer
What's my optimal choice for remote access to my localhost sites?
1 votes

This isnt a direct answer, but maybe can solve your problem. Why just dont open a port on your router to the local server?! I use apache2 has localserver and apache2 uses port 80 as default and also ...

View answer
display product's category static slider name and image in loop wordpress
Accepted answer
1 votes

This is for showing the name and image of each product category, with a link to the categories woocommerce page. To get it automatically on a dynamic way it's possible by using the function get_terms()...

View answer
How to remove double quotes in a shortcode?
0 votes

do a print_r to your $a variable, there you see everything that is happening echo '<pre>'; print_r($a); echo '</pre>'; die(); this way you can see if the url variable has double quotes, ...

View answer
how to add a custom javascript file to our theme
0 votes

Having this issue for months and I got it now running when I posted the question here. the issue is that the wp_enqueue_script needs to have the script file register first. So I have it working this ...

View answer
Dynamically populate the menu when a new category is created
0 votes

yes, of course it is possible to do. Here is the code to get all the categories on a page load, this code is prepared to go until the 3rd category generation. $cats = get_categories( array('taxonomy' =...

View answer
Restrict WordPress Media Library for a specific user role (users can only see/select own media)
0 votes

to protect your image folder try use this Add a simple .htaccess file in your site folder with the following lines RewriteEngine on RewriteCond %{HTTP_REFERER} !^http://www\.your-domain\.com/.*$ [NC] ...

View answer
How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
0 votes

your checkboxes have the same id, the id is unique, otherwise would be a class. in the forms the checkboxes should use each one an unique id and name,check this example at w3schools.com then when ...

View answer
Maintenance mode excluding site administrators
0 votes

Only administrators already login will have access to the website, no one else. just change the $url variable to your url where you have the maintenance page desired. function wp_maintenance_mode() { ...

View answer
How to change page title (from a plugin) in twentytwentyone theme
0 votes

this code should do the trick, add it to your theme functions.php, or to your functions file in the plugin add_filter("pre_get_document_title", "dynamic_page_title"); function ...

View answer
Restrict WordPress Media Library for a specific user role (users can only see/select own media)
0 votes

add this to your functions.php or in a snippet, with this code the users with role external will only see their own uploads, any other role will see them all just has before. add_filter( '...

View answer
Trouble inputting variable into WP query
0 votes

your right answer could find an issue, when $i is less or equal to zero will trow an error, that $sector is being used by the first time, so one way to prevent that is function prefix_get_wp_query( $i ...

View answer
WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
0 votes

So I would take of on your html form the onsubmit()=..., once isnt needed and your javascript function should only have something like this. document.getElementById("form_1").style.display = ...

View answer
Trouble inputting variable into WP query
0 votes

if your second code works correctly, just do this $option = "b4_settings_homepage_category_".$cat; $sector = get_option($option)[0]; this will make your option with the cat variable, for ...

View answer
Modify wp_installed_email / wp_new_blog_notification
0 votes

just an opinium, each wordpress plataform is only instaled one time, and each time only the email registered will receive the email. Not my business, but isnt this worthless, if the person is ...

View answer
I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
0 votes

I would stick to make the url https://example.com/life/life-article/?special=1 I would create a php function that: retrives all posts and stores them in a variable; make a loop to loop all the posts ...

View answer
Remove character from permalink
0 votes

to achieve that is not easy, this to say almost impossible, the permalinks are made by the slugs, and the slugs have a function called sanitize_tittle(), this is probably what is doing that to your ...

View answer
Issue adding sub category programmatically
0 votes

with this code we add a new main category wp_insert_term( 'My New Category', 'product_cat', array('parent' => 0)); then knowing the category parent id we can add a sub category like so ...

View answer
does using wordpress outside wordpress installation makes site slower?
Accepted answer
0 votes

lets say, you want to create a website in php or html, css and javascript that doesnt use wordpress, thats ok, you can do it. But you wanna use wordpress things like products or posts or images, and ...

View answer
301 all old pages to new location
0 votes

have you try to make a backup of the old website and upload the backup in the new website, in this case in the main domain. Normally I use the plugin "wordpress all in one" to do this. I do ...

View answer