Loop issues when creating custom query for media uploader

I’m not entirely sure why the get_posts() function works instead of creating a new instance of WP_QUERY. From what I understand about how WordPress queries work, get_posts() is actually creating it’s own instance of WP_QUERY anyhow. Either way, here is the solution that I’m using currently. <?php //GET THE PHOTOGRAPHERS $args = array( ‘post_type’ => … Read more

How i can upload images to another folder?

In WordPress we can change the default location of the wp-content folder by defining a couple constants in wp-config.php about it here on Codex So if the structure on the server looks like this: /root/ 1. myblog.tld – its own directory 2. sub.myblog.tld – its own directory You can use this in your wp-config.php: define( … Read more

how to upload and allow downloads of .mobi and .epub formats

Assuming that you are using the WordPress native Media uploader then you can use the upload_mimes filter hook to add or remove allowed file types, for example: function custom_myme_types($mime_types){ //Adding avi extension $mime_types[‘avi’] = ‘video/avi’; //Removing the pdf extension unset($mime_types[‘pdf’]); return $mime_types; } add_filter(‘upload_mimes’, ‘custom_myme_types’, 1, 1); You can see that to add a file … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)