Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ziggyzack99

    (@ziggyzack99)

    I need help.

    ZiggyZack99,

    All Attachments/uploaded contents are always stored in the wp-contents/upload folder. But in that folder wordpress is creating folder with year and inside that another folder with month.

    If today I upload one screen capture then it will be stored on the server at below mentioned path:

    wp-content/uploads/2008/10/screencapture.jpg

    [spam link removed]

    Thanks,

    Thread Starter ziggyzack99

    (@ziggyzack99)

    Thanks, accuweb, but what I was looking for was something that would look nice and be with my theme that displays all attachments and links to their respective pages.

    Thread Starter ziggyzack99

    (@ziggyzack99)

    Help?

    I don’t know if there is any command for this, but you can do it as following:

    To display all the uploads / attachments, you need to change path of your upload directory, change that path under your theme files and you shall be able to display all the attachments by a public URL.

    I think you can just take it from the database. It would look something like this. And take a look at the names used in the table – you can use all of those.

    global $wpdb;
    $attachments = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'posts WHERE post_type="attachment");
    foreach ($attachments as $attachment) {
       echo $attachment->post_title;
       // etc your code goes here (display what you want)
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘All attachments view?’ is closed to new replies.