I'm outputting some files from the media section on a page (i'm using a plugin called related links to do this). I have access to the id of the file....I need to query wordpress based on this id to get the upload date and description.
How do I do this? Can't find info on this in codex
I'm using this solution: http://www.emmanuelgeorjon.com/eg-attachments-1233/
Good luck! :)
Related
I am parsing a Wordpress feed in my iOS application. I don't know much about Wordpress and its customisation. The feed shows the author name as below:
<dc:creator>andy</dc:creator>
while i want it to show the full name of the author in the feed like:
<dc:creator>andy rubin</dc:creator>
Can anybody point out where i can go to do that. Thanks!
Open your Wordpress dashboard and go to Users > All Users and select edit for the user for which you want the full name to appear. You will see the option "Display name publicly as". From drop down list you can choose the full name.
In the feed you might still see first name but once you parse it in your iOS project, it will show you the full name.
Hope this helps!
There are a variety of ways to customize your feeds.
1 - through the use of a WordPress pluggins such as http://wordpress.org/plugins/feed-template-customize/
2 - changing display settings from the Wordpress dashboard
3 - or by manually changing the feed templates to meet your needs
Editing your feed templates manually is much the same as editing your theme templates but not integrated into WP theme system
The Feed templates are located in the /wp-includes/feed-{type}.php files and include formats for rdf, rss, rss2 and atom but it is better to do not edit directly the files from this folder.
You can follow the Customizing Feed Templates section of the codex and peek the function you need from this list and use it within the Loop.
First of all, I am absolutely new to WP.
I am hoping to build a site using WP and figured out how to manage every thing except one feature. The feature that is required is to be able to submit a form with files (images in particular) by a non member.
For example, you should be able to visit the site and fill a form and submit your image along it.
Is it possible to upload files as above? How is this achievable?
Thanks in advance.
If you are not a wordpress coder , I would sugest you use a plugin for that .
Some options :
http://wordpress.org/extend/plugins/user-submitted-posts/
http://wordpress.org/extend/plugins/tdo-mini-forms/
http://wordpress.org/extend/plugins/quick-post-widget/
http://www.gravityforms.com/category/features/
and many more ..
read also this tutorial : http://wp.tutsplus.com/tutorials/allow-users-to-submit-images-your-site/ - it is not for VISITORS but for registered users - but it might help you to understand what is needed to be done .
I would use the Contact Form 7 plugin to do this, as it's extremely easy.
In the plugin settings you'll be able to choose what parts of the form you'd like to include, adding a way to upload is one of those options. You can even limit the type of file that is being used as well the max file size.
Once you create a form in the settings, you just use its shortcode to add it to your Wordpress page.
Yes you can upload file, but it is not a Wordpress specific solution, unless you want to use a plugin. You can code html/php as per usual to achieve it:
http://www.w3schools.com/php/php_file_upload.asp
To embed it on a page, you can create a Page in Wordpress, and assign it a custom page template that you create with the upload form:
http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates
I'm very new to WP development. I host a website which needs a list of trails (hiking, biking, etc) and I'd like to write a WordPress plugin to do it.
Can someone please tell me if I'm taking the right approach, and if what I'm proposing is possible.
I'd like the site to end up with an auto-generated and filtered index at http://example.com/trail-guide, and the discrete trail info pages at http://example.com/trail-guide/trailname. This data would all be stored in a single database table holding info for each trail, with an admin page for adding, editing, and deleting entries from here.
Is a WP plugin the best way to go about doing this, or should I be looking at something else?
From the way you're describing, your best bet would be to Register A Custom Post Type. This can be done by adding to your existing theme's Functions.php file, or by creating a plugin.
If you don't plan on changing themes, my advice would be to just hardcode everything into your functions.php file. Otherwise, creating a plugin for this particular job would be the safest alternative.
Using this functionality in tandem with Custom Meta Boxes and Custom Taxonomies will allow you to keep everything organized within the Wordpress Framework with your own special data.
This means that these new posts can also be queried at any time through the standard Wordpress Loop or search box.
If you are uncomfortable with writing your own functions to extend your existing framework, you might want to look into some plugins like GD Custom Posts And Taxonomies Tools to manage your own.
Hope this helps.
I'm currently learning wordpress and I have a project where I need to create an audio podcast gallery, so users can find all podcasts, read description and download it.
What is the best method to achieve this gallery? Do I create a podcast page on wordpress and use custom fields meta function? or maybe there's a plugin? I just need to know the right method to achieve this.
I need more info about best method to create this gallery. The idea is very similar to this: http://www.bbc.co.uk/podcasts
I created a podcasts category. Then view the category's page, eg example.com/?cat=4 to see all of your podcasts.
Note, your url will have a different cat number.
I am using Wordpress's add_meta_box() function to add customized meta fields to the Add New Post page, like this. I want one of these fields to allow the user to upload a file, so that a single image, pdf, audio file, or video can be associated with the post.
The closest example I've seen is this one (link removed*). Unfortunately it does not suit my needs, as I want my file to be processed by Wordpress's Media Uploader - so it should appear in the Media Library afterwards, and thumbnails should be generated according to the Media settings.
I think ideally there would be a way to tap into Wordpress's existing Add Media dialog, and simply output the URL of the uploaded file into a text box, but I don't see how to do that. This question is similar, but the answers are a little clunky - I would like to keep this super simple for my end users.
How can I accomplish this? Please do not recommend plugins such as Flutter or Magic Fields - I have tried these and they do not suit my purposes (I want the images to be processed by Wordpress's Media Uploader). I am using Wordpress 3.0-alpha.
(*=link removed due to report of malware; it is in the archive, but at own risk)
I eventually figured this out for myself and got it working just as I wanted, and thought I would post an update for anyone who finds this question and is curious.
I did not use any plugins, but wrote a custom function to handle file uploads for my theme. I used built-in Wordpress functions such as save_custom_postdata(), wp_handle_upload(), wp_insert_attachment(), wp_generate_attachment_metadata() and wp_update_attachment_metadata().
I also had to use add_action('admin_head'...) to add some JavaScript which adds "multipart/form-data" to the form tag on the Edit Post page, to allow file uploads.
I would post my code, but it is very long and specific to my project.
You needn't use JavaScript to edit the form. This is possible to do using the post_edit_form_tag function like so:
add_action( 'post_edit_form_tag' , 'post_edit_form_tag' );
function post_edit_form_tag( ) {
echo ' enctype="multipart/form-data"';
}
More details (including an example) are available at http://codex.wordpress.org/Plugin_API/Filter_Reference/post_edit_form_tag.
Take a look at Image Widget - a well made widget that does what you want, but as a widget. Maybe you can convert it to work on your Add new post page.
Another plugin you can try is Pods CMS. Might be overkill but when you do fileuploads with this, they are automaticly added to the media library.
This WordPress Meta Box PHP Helper class might help you when working with WordPress Meta Boxes.
I think this is what you're looking for: http://wordpress.org/extend/plugins/nkmimagefield/
Apparently it doesn't support custom post types but a little hacking should do. It already does the hard work of interfacing with the media editor.