dehuszar
Forum Replies Created
-
Forum: Plugins
In reply to: order by ‘meta_id’I am looking to do the same thing.
I have multiple values assigned to respective custom fields and need to be able to have them spit out in the order they were entered. Right now, I’m not sure what’s happening, but when pulling the arrays using get_post_custom(), is that the keys are not coming out in the right order.
As an example, I’m entering items into custom fields in the following order:
[keyX] => Item 1 [keyX] => Item 2 [keyX] => Item 3 [keyX] => Item 4 [keyY] => Item 1 [keyY] => Item 2 [keyY] => Item 3 [keyY] => Item 4
…and when I do my foreach loops so I can place them into the templates, they come out like so:
[keyX] => Item 4 [keyX] => Item 2 [keyX] => Item 1 [keyX] => Item 3 [keyY] => Item 3 [keyY] => Item 1 [keyY] => Item 2 [keyY] => Item 4
Now, the astute will notice that those patterns are the same, but inverse; and both the incorrect order.
Now I’ve looked at the post_meta table in the db, and the meta_id values for each entry are all in the right order for each key were I to have them sorted ascending by meta_id.
So if I know at what stage, and based on what criteria, get_post_custom() sorts by default, or I can figure out how to sort the results of a better query by meta_id, then I should be able to ensure the results get spit out in the proper order in my template.
Any help would be GREATLY APPRECIATED!!!!
Thanks in advance.
Forum: Plugins
In reply to: [Plugin: Custom Field Template] Sort Order not workingI am also having this problem. I want to create attributes for multiple video elements using custom fields. I require the use of multiple values as multiple videos are being entered into a single post.
I’m finding that when I use custom fields straight out, they will display in the order they were entered, so if I enter in the values of “apple” “orange” “banana”, in that order, they output to:
0 => "apple" 1 => "orange" 2 => "banana"
And that works great! Now that I’m trying to use the Custom Field Types plugin to clean up the entry process, the order of these entries are getting mangled.
Any recommendations as to how I can maintain the order of multiple entries which share the same key? Is the plugin sorting them a certain way by default? I’m using the PHP Code system (and it works REALLY well, thank you!), so if there’s a way to sort them there, I’ll be happy to implement that.
Forum: Plugins
In reply to: [Plugin: Custom Field Template] Issue with drop down html outputI am having a similar problem. I am trying to create a select list from a variable which contains an array (specifically of images attached to the post, but when clicking on the dropdown I only see the variable in plain text. Any help would be appreciated.
The custom field key looks like this:
[color-splashes] code = 0 hideKey = true label = Upload Color Splash multiple = true multipleButton = true type = select value = $attachments
And the code 0 block looks like this:
$attachments = array('post_type' => 'attachment','numberposts' => -1,'post_status' => null,'post_parent' => $post->ID);
What am I doing wrong?
Please?
Okay. No takers.
Another related question then…
I’ve been looking through the get_attachment functions. I’ve seen how I could call a file attached to a post if I knew the attachment ID, but is there a way to query a list of objects attached to the current post?
What I’d like to do is use custom fields, and custom meta-boxes to create a drop-down select list of attachments so if I can’t programmatically upload the URI of an attachment directly into a custom field, I can at least have the client upload a batch of them and then select the attachments from a list in the relevant custom fields.
Any ideas?
Thanks in advance.
Forum: Fixing WordPress
In reply to: Changing post types of existing posts?I will try this, thanks!
A quick follow-up to my question about documentation and tutorials…
I would ideally like to apply type => file to a custom field input, and have the $_SERVER[‘PHP_SELF’] of the uploaded file to post into a pre-determined custom field, or to just be able to use the uploader to attach media files to the post, and then use a select list to choose the image from a list of attachments.
Is there a way to separate the editor from the media uploader, or manually call functions from the uploader so that I could have an “attach media” meta_box where the client uploads videos and images to the post, and then a more specific meta_box where the client can then select the attached images in a way that tethers the URL for said media upload to the intended custom field?
A quick follow-up to my question about documentation and tutorials…
I would ideally like to apply type => file to a custom field input, and have the $_SERVER[‘PHP_SELF’] of the uploaded file to post into a pre-determined custom field, or to just be able to use the uploader to attach media files to the post, and then use a select list to choose the image from a list of attachments.
Is there a way to separate the editor from the media uploader, or manually call functions from the uploader so that I could have an “attach media” meta_box where the client uploads videos and images to the post, and then a more specific meta_box where the client can then select the attached images in a way that tethers the URL for said media upload to the intended custom field?
Forum: Fixing WordPress
In reply to: Keeping local/dev and server installations in sync…but I can’t use bloginfo() in a post, can I? I thinking about links to uploads, etc. I currently have to export the SQL file and run querys and replaces before importing it to the new system.
Relative link support in WordPress would be golden. I’m not sure why there’s no support for it.
Forum: Fixing WordPress
In reply to: Gallery Shortcodekinglu, can you tell me how exactly you resolved this problem? I am using Sandbox as well (or at least calling Sandbox into a custom theme) and I cannot get the shortcodes to work.
Thanks in advance.
Forum: Themes and Templates
In reply to: Problems using the Sandbox theme with Blueprint CSS grid systemIt turned out to be a caching issue which is very strange because it always happened on the same file from project to project. Next reboot, no problems.