Global variable $post returning incorrect object

Why is test-product-magazine, instead of the correct, shop? The global $post object is not a reliable way to determine anything about archive pages because the object will typically be the first post of the main query when outside the loop. Since the main query is for the posts in the archive and not the archive … Read more

action is not called after a php request

I just solved it! The problem was, that the php request handling works different in wordpress. There has to be a workaround with a admin_post.php hook: Instead of if( isset($_POST[’email’]) && isset($_POST[‘title’]) ){…} I had to use this hook: add_action( ‘admin_post_nopriv_process_form’, ‘process_form_data’ ); add_action( ‘admin_post_process_form’, ‘process_form_data’ ); function process_form_data() { my_function($_POST[’email’],$_POST[‘title’]); wp_redirect($_POST[‘url’]); } A hidden … Read more

Taxonomy linked to pages

Both your double and single quotes are not the correct kind in this block of code. Also, the taxonomy name is ‘colecciones’ with a small ‘c’, but you used ‘Coleccions’ with a capital ‘C’. The match is case sensitive. Thus your function code should be: function show_product_colecciones(){ $collections = wp_get_post_terms( get_the_ID(), ‘colecciones’ ); $collection = … Read more

Image as Sales Badge

Change your image url to “/wp-content/uploads/2018/01/in-stock.png” That way even if you change servers (or changed domain name), as long as the filepath doesn’t change from wp-content, you’ll still be safe.

How to add values to media “whitelist_options” in wp-admin/options.php template?

firstly, don’t edit core files of WordPress or your changes will be erased at the next update. in the file options.php look below this array declaration, you have this line : $whitelist_options = apply_filters( ‘whitelist_options’, $whitelist_options ); that means that you can custom this array with this code in a plugin or the theme : … Read more