Make division in post_query?

MySQL can do math but can’t pass it through query_posts like that, or any WordPress’ post query functions, which depend upon WP_Query. They will literally look for a table/column named, in your case, “meta_value_num / date”. To do it in SQL I believe– aka., this is untested– you’d have to do something like this: SELECT … Read more

Selectbox and Searchform and Custom Search Page

Welcome to WPSE! First of all – you cannot have two (or more) elements with the same ID. Second – your select elements lack name attribute and browser doesn’t actually submit anything. Third – you cannot just expect to throw a bunch of selects into the form and expect everything to magically work. In order … Read more

Are taxonomy hierarchies possible?

I have run into similar problem with the system I am currently building – I needed ZIP codes to be children of Cities, which were to be children of States. What I have learned is that it was possible to add custom fields to the term creation form to link the term (e.g. ZIP) to … Read more

My AJAX API plugin isn’t working

There is no PHP function alert, that’s why your function throws an error and doesn’t proceed with the rest of your code. You have to return something from the LogHit_callback function using return (or echo it with echo) and then alert it with JavaScript, that is add following code to your post function: jQuery.post( ‘http://www.test.com/wp-admin/admin-ajax.php’, … Read more

Make videos output as iframes not links

Copy paste from my answer here but with iframe/video mime type added: Alter image output in content function WPSE_80145_Mime($html, $id) { //fetching attachment by post $id $attachment = get_post($id); $mime_type = $attachment->post_mime_type; //get an valid array of video types, add any extra ones you need $image_exts = array( ‘video/mpeg’, ‘video/mp4’, ‘video/quicktime’ ); //checking the above … Read more

Performance and styles not working fine after changing permalink structure

Your .htaccess should not be modified on the WordPress part, so it should always be: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress It looks like if you have your WordPress install in a Subdirectory of … Read more