billray
Forum Replies Created
-
Forum: Plugins
In reply to: Images hack. How to?Question: How are your images organized? Are they in a gallery attached to the ‘Anna Pacquin’ post? if so, you may find pulling attachment images from a post thread helpful.
pseudo code:
render a post displaying full sized image
if (attachments) cycle thru each attachment
render thumb
endifForum: Fixing WordPress
In reply to: is_category in Sidebar.phpIt’s a bit of a hack, but when I couldn’t get the ‘cat’ to come over to my sidebar, I resorted to ($_GET[‘cat’]) in the sidebar to dynamically change portions of the sidebar depending on the category being called.
I had a lot of query_posts and rewinds in my category pages…
Forum: Alpha/Beta/RC
In reply to: Multistep image upload in 2.7: yuckThat’s what I thought.
Are there any plans to allow you to modify the parent post id for images uploaded into the media library.
For a lot of the stuff I’m doing, mostly work for art galleries, clients put one piece of art per post and I’ve written a bunch of scripts to render the images in various different ways. Unfortunately, I’m a forced into getting at the image source using the attachment id.
If a client screws up and uploads a bunch of art into one post, then all of my code breaks.
Forum: Alpha/Beta/RC
In reply to: Multistep image upload in 2.7: yuckOtto42,
I watched your screencast and have a question. When you upload a number of images but only use one in the post, what is the setting for the post-parent id for the ones that aren’t currently being used.
Do they ‘default’ to the post id of the post that you were working on when the images are uploaded?
Thanx
Forum: Plugins
In reply to: Second page to show only posts from ONE categoryHow about making a category page for category 304
Forum: Plugins
In reply to: Lightbox style message?Don’t know if there is a specific plugin but looking at the example, it looks like it’s done with ThickBox, the jquery add on. (Both of which are ‘included’ in WP 2.6.2
Forum: Fixing WordPress
In reply to: Excluding captionsI’ve dealt with similar issues. I’m not a rocket scientist, but this is what I’ve been able to piece together from various posts. Take it with a grain of salt, and others, please correct me if I’m wrong.
It’s long, but here goes…
I’m assuming that you don’t want captions in posts either with a thumb, medium, but you do want them for a full size image that is rendered in ‘attachment.php’ Remember, the caption is merely part of a post’s html content. Bottom line, you want to play with the captions, not WP. Maybe you can do this with pure css and wp-caption and wp-caption-text. But, here is what I’ve learned about images, attachments, attachment_id’s, etc.
If you want the caption for when the full size image is rendered but not when showing a thumb, you may want to get at the image directly through it’s attachment id. In 2.6.2, I find the relationships between the post id, attachment id and parent ids to be very fragile and somewhat counter intuitive.
Images when uploaded through the media library are assigned an id and a post type of ‘attachment’ They live in the the wp-posts table as just another post with a post_type of ‘attachment.’ You will see the ID referred to as the attachment id. Also, the image when it is uploaded is assigned a post parent, in effect the post id of the post the image is ‘attached’ to. But don’t be fooled and be careful.
I learned this the hard way. What I wanted to do was assign one image to one particular post. So, I opened up a post, say Post ID 252 and I uploaded one image and inserted it into the post. Feeling confident, I uploaded some more but DID NOT insert them into the post (again, 252). I thought I’d just throw the images up there and use them latter. Wrong, all of the images I uploaded, whether actually used in the post or not were assigned a parent_id of 252. What I thought would happen would be I’d only have one attachment id’ed image with a post parent of 252 but I got a bunch.
So, why does this matter to you? Let’s say you add another post, now 253, insert a previously uploaded image into the post. Well, that post really doesn’t have any attachments, hence no attachment id’s associated with it. It has an embedded image, the old fashioned way with html. No database relationship between post 253 and the embedded image exists.
So, if you want to ‘pull the latest attachment from a post‘, (a marvelous thread by the way) to get at the img src to handle it the way you want, you can’t — no attachment_id.
I’m not smart enough to figure out the best way around this. It appears you have really two choices — you could parse the html of the post with the embedded but non-attached image and pull out the attachment ID that WP put’s in there, or you can be amazingly careful when using the media uploader, i.e., create post, upload image, insert image, save post, repeat.
For me, I had to manually go in and get the attachments to really marry up with the posts I wanted them to be attached to with mySQL Query Browser.
Forum: Fixing WordPress
In reply to: <?php the_category(‘,’ ); ?> without link?<?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?>Discussed here. Does that work for you?
Forum: Fixing WordPress
In reply to: Media Library Appears With – How to update/changemoshu,
Understood. I’m looking for a way to get at the url programatically. I was hoping to use the attachment_id so I could query, cycle through the qualifying posts, and pull the first image in the post. Similar to the approach taken in the thread pull latest attachment from post.
To my original question, I have a bunch of images in the library, and I subsequently wrote a single post for each image. I just need to get at the attachment_id or the url of the image contained in each post.
Usually things are so easy in WP, so I must be missing something.
Forum: Fixing WordPress
In reply to: Media Library Appears With – How to update/changesorry, the url.
Forum: Fixing WordPress
In reply to: Media Library Appears With – How to update/changemoshu,
thank you so much for the reply.
So, if I want to get at the filename of the original image that I have inserted into a particular post, the original, not the wp ‘crunched’ version, what is the easiest way to get it?
Forum: Fixing WordPress
In reply to: What constitutes an Attachment? Need clarification.Justin/Greenshady,
Thank you for the clarification. I am trying to use your plugin and the fact that I uploaded some images to the media catalog, then posted got me quite confused.
So, if again, I want to have basically one image per post and not use gallery what is the best way for me to solve the problem. [I need to get at the full sized jpg file name for additional processing).
I noticed that in the post html wp puts in the attachment id but I certainly don’t want to have to parse the html just to get at the file name.
Is the parent-post id the way to get at it? Normally everything seems a little easier in WP than this media library stuff.
Forum: Fixing WordPress
In reply to: What constitutes an Attachment? Need clarification.I’m confused on 2.6.2’s media library and the relationship between the attachment_id and the post_id.
I want the filename/url of the first image attached to a post. I want the file uploaded — pre crunching by media library. I need to get at the jpeg associated with each post so I thought that getting it by attachment_id would be the best approach.
I have inserted one image per post from files contained in the media library. The images show up fine in each post, but I’ve noticed that in the media library sub-panel that the ‘appears with’ column is often blank.
So when trying to pull the latest attachment from posts as discussed, I’m not getting an attachment_id returned.
Any help would be appreciated.
Forum: Fixing WordPress
In reply to: How to create thumbnails manuallyTry the regenerate-thumbnails from viper. I haven’t fully tested it, but it appears to work.