0
votes
0answers
21 views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
0answers
40 views

How to attach image to custom post type

I am using this answer to upload files in my custom post type meta box. How do I attach the actual attachment post to parent post(custom-post-type), so that in wordpress admin, I know that the image ...
1
vote
1answer
26 views

Return Attachments from Custom Post Type

I'm a fairly new WP developer. I am trying to get my portfolio.php to display all images attached to my custom post type 'portfolio', and then display them in a masonry format. I've managed to get ...
1
vote
1answer
47 views

How to get attached file in wordpress from custom post

I am using the Download monitor plugin I am listing the posts by category the following way $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); <?php ...
0
votes
2answers
55 views

Correctly delete posts with meta and attachments [duplicate]

I am having an overview of custom post types: http://www.citizen-science.at/wordpress/projekte/roadkill/ubersicht/ These have custom tax and also an attachment. In my overview I need to provide ...
0
votes
1answer
14 views

Delete attachment with post

I'm trying to post a delete Link for a user so he can delete his own entries: global $post; if ( !current_user_can( 'delete_bkroadkill', $post->ID ) ) return; $link = "<a href='" ...
0
votes
0answers
19 views

Attaching unique images on common template

I'm building a membership site with enhanced user profiles and multiple profile types. I'm using custom post types and Advanced Custom Fields. I'm using a single template for updating the profile ...
0
votes
0answers
48 views

How to search attachments (images) and posts in WordPress of a given post type

I'd like to extend the search functionality in a WordPress blog in order to search a custom post type including its attachments. I got some progress searching posts and attachments, also excluding ...
2
votes
1answer
103 views

Impossible to get Attachments Outside Wordpress?

My page (outside the wordpress install) begins something like this: global $wpdb, $wp_query; define('WP_USE_THEMES', false); include_once 'word/wp-blog-header.php'; $args = array( ...
0
votes
0answers
59 views

Failed to load the image url from using another database

this is the site to display the images I have created the two websites. The main website having common database for both. In main site the is no problem it will display the images but here i am using ...
0
votes
0answers
61 views

Custom post types images go to a specific folder, not the montly one

I have a website which allows "mini sites", meaning custom post types. We noticed that the images that are published along the mini-sites reviews go automatically to the same month, while regular ...
0
votes
1answer
206 views

Show list of custom posts with respective attachments?

I would like to construct a query to show a list of custom posts ("podcasts") with the urls to their respective attachments. Each custom post_type ("podcast") has 1 attachment (the mp3 file belonging ...
0
votes
1answer
66 views

How do I add multiple post types to this query?

The code i use calls for all attachments that are uploaded to be in the post. I added the Gallery custom post type but nothing shows. It shows on my "pretty-little-liars" post type though. What am I ...
0
votes
1answer
33 views

“After file loaded” action

I have a plug-in that allows for repeatable fields. There will be an image and the image description. The description allows for tinyMCE editing. There are obviously problems with this, but I think I ...
2
votes
4answers
2k views

get attachments for all posts of particular post type

I'm making a widget that shows a set of images from recent custom posts. I want to run the following query: SELECT p.* FROM wp_posts p WHERE post_type='attachment' AND post_mime_type LIKE 'image%' ...
3
votes
2answers
1k views

wp_generate_attachment_metadata gives me an empty array

I have a custom post type and a metabox with a file input. I can insert the attachment, but I can't update the attachment metadata and I don't know how to fix it because I don't receive any error. ...
3
votes
3answers
478 views

List most recent image uploads, but only for specific custom post type

I can get a list of the most recent image attachments like so: $attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => $number, 'post_mime_type' => ...
1
vote
1answer
1k views

Count all images of a certain post type

I followed two posts related to my query. One was about the number of images attached to a post and second about showing all images of a certain post type. I tried to combine the two codes in the ...
0
votes
2answers
173 views

Why doesnt my tag page populate with this custom post type?

I have a tag page that is generated with the first image attachments from all of the posts. I call it in the loop with : <img src="<?php echo get_first_attachment() ?>" /> and this is ...
1
vote
1answer
568 views

Custom Post Type - List all attachments on Edit Screen

I'm currently building a custom post type in Wordpress and I need to be able to list all attachments inside the edit screen. I know how to do this on the front-end template, but anyone know the code ...
6
votes
3answers
15k views

Submit post and upload image from front-end

I am trying to do something similar to the above question. I am trying to make users post and upload images from front-end. I have already done the post form and its working. I just followed and ...
1
vote
1answer
2k views

How do you modify the 'post_parent' of a custom post type?

I want to be able to edit the post_parent of a custom post type. Basically in my use case I want to mimic how WordPress uses attachments: have a custom post type that is sort of a subtype to post or ...
1
vote
2answers
278 views

Why can't my admin account manage attachments on a custom post type with a unique capability type?

I've created a custom post type called 'directory' and assigned it the capability type of 'listing'. It has a unique capability type because I want to restrict Contributors to only be able to ...
6
votes
2answers
5k views

Attaching media to custom posts without editor

I'm creating a custom post type, "gallery", in which the admin should be able to upload images (these images would be attached to the post). The thing is that the "editor" meta box is disabled for ...
12
votes
2answers
5k views

Creating an Image-Centric Custom Post Type?

Does anyone have any tips for creating an image-centric custom post type? To elaborate, my blog has rotating header images, shown below: The two images in the top left are randomized, and exist as ...