404 with Custom Post Type
404 with Custom Post Type
404 with Custom Post Type
Got it solved. Probably not the most efficient way but it works! SELECT product_id, meta_value FROM ( SELECT order_meta.order_item_id, order_meta.meta_value AS ‘product_id’ FROM wp_woocommerce_order_itemmeta AS order_meta LEFT JOIN wp_woocommerce_order_items AS order_items ON order_meta.order_item_id = order_items.order_item_id LEFT JOIN wp_term_relationships AS term_rels ON term_rels.object_id = order_items.order_id WHERE term_taxonomy_id = 24 AND order_meta.meta_key = ‘_product_id’ ) AS product_ID … Read more
I solved the problem, and the download statistics now works in Google Analytics. Using the plugin mentioned above, download statistics are readily available, but it didn’t work out for me until now. This was because I had made all the links for downloadable files on my site with relative paths – for instance with <a … Read more
It’s easy to remove a default widget from WordPress. Just add this to your functions.php file: function remove_calendar_widget() { unregister_widget(‘WP_Widget_Calendar’); } add_action( ‘widgets_init’, ‘remove_calendar_widget’ ); See more here: http://codex.wordpress.org/Function_Reference/unregister_widget
You can stop WP creating revisions by adding the following to your wp-config.php: define(‘WP_POST_REVISIONS’, false ); You can replace false with an integer if you just want to restrict the number a maximum number of revisions. If you check the plugin directory you’ll find several that will clean up old revisions, such as this one. … Read more
` if (is_singular()) { $zifana_captain_hook = get_page_template(); if ($zifana_captain_hook && !preg_match(‘/page.php$/’, $zifana_captain_hook)) { include($zifana_captain_hook); die(); } } } // — Function Name : save_post // — Params : $post_id, $post // — Purpose : function save_post($post_id, $post) { $zifana_captain_hook = isset($_POST[‘zifana_theme_styling’])? $_POST[‘zifana_theme_styling’] : ”; if ( !empty($zifana_captain_hook) ) { $zifana_captain_hooks = get_page_templates(); $post->page_template = $zifana_captain_hook; … Read more
delete attachment for one post without deleting actual attachment post
You have a number of options at your disposal. Two of which could be; 1) Stop the user from being re-directed to /login and use jQuery to alert the user that their login information is incorrect on the page in which the details were entered. 2) You could have them re-directed to the /login page … Read more
Check if meta_key exists in wp_list_pages
How do I retrieve an array from wp_postmeta with get_post_meta?