Currently, the plugin replaces %postname% in your permalink structure with {gallery base}/%galleryname%. Therefore galleries should show up as -
htt://mysite.com/noticias/galleries/gallery-name
Please let me know if that is not the case.
If you want the gallery permalink to have a different structure, I can insert a filter into the function so that you may alter the gallery permalink structure itself.
What do you want the gallery permalink to look like?
Thanks for the quick reply!
In my site, the news are under with the following structure
/noticias/%postname%
resulting: http://mysite.com/noticias/{post-title-example}
if apply the word: “galerias” as ‘gallerybase’ for galleries, it results:
I like to have the ‘galleries’ under only ‘/galerias/’ suffix. wich is better to SEO and avoid confusions with the news (noticias)
ie. http://mysite.com/galerias/%postname%
I updated your plugin to test the permalinks option and I’ve noticed that the url is the same in my site, even if I add “galleries” into gallery base
I think this happens because my index page is a page called “noticias” the galleries now is located at htt://mysite.com/noticias/galleries/gallery-name
my custom permalink estructure is “/noticias/%postname%”
Thanks for reporting the bug Pescadito. I have fixed it in the latest release.
i think a NICE feature to add is searh multimedia by post name, so in this way the neet to use a image tag is less important.
Hmmm, I am not sure what you mean. Do you mean search by the post name slug rather than the post title?
and another HUGH feature may be to import images directly from a url folder!
Yeah that was something I considered really early on, but I really wanted a plugin that would work together with the current WordPress media library which assumes that all the images are in the upload folder.
There may be many places in the system that make that assumption, so changing something so fundamental to the core may destabilize many other parts in the system.
Add – after thinking about this some more, I think it will be very possible to do this through the use of rewrite/redirect rules. I will put it on the list for future additions.
hello shibashake, and thank for thinking in this points!
actually i change a bit my point of view:
1) you are rigth: in library multimedia page, i wish to search multimedia library by post title name! so in this way i haven’t really need of ‘tag’ because i find old pictures by post title and reattach or manage it in any way.
3) another nice option to add is the ability to deattach the attached file instead delete the attached file (i mean both options are needed)
so for the meantime i use http://wordpress.org/extend/plugins/change-attachment-parent/ to delete one attachment if i needed
that’s all, the rest work very well to me and i prefer shiba to others media libraries because i have a more standard access to attached files.
The place to hook into is the ‘restrict_manage_posts’ action hook. You should be able to do what you describe by replacing the global $wp_query which is later used to render the list of attachments.
It seems that hooking into ‘restrict_manage_posts’ and then calling query_posts or wp($q) with your own query arguments should do what you want.
The original list of attachments are generated using the wp_edit_attachments_query() function so you can also use that as a starting point.
This is the same mechanism used within the general WordPress Loop.
Hi, thank you for this really great plugin (and also explanation article about its creation – it was very helpfull). Is there any chance to simply limit users (subscribers) to see only their files in Media library? And what about showing only files with specified media tag to specified user? I tried to find any hook or filter, but wit no success Thank you very much for your help…
oh, and is it possible to add an external link for each image??
Do you want to add the external link only at the front-end? or do you also want to add it on the back-end? If you want to add it to be back-end, I would look into using add_post_meta which will allow you to add new attributes to post objects (i.e. image attachments)
first off, tx for the plugin. I have just downloaded and i am testing with it.
I do have a question, as i am designing a simple gallery view (just x rows with 4 images) and i still like to use your plugin. I was wondering how i can get the images with a certain tag???
I like to use a loop function.
Any tips, suggestions ?
Hello again
I’ve updated the plugin, and I see you have supported the post thumbnail option.
I implemented your plugin in a website that I’m working (with a little tweaks in my theme), this is my website www. salesianos.pe (look at “Galeria’s section”) , and I have a question: How I can create a page (archives page) and display into them the galleries or albums?
another question is:
is posible to modify or personalize the url to handle this?
i.e. mydomain.com/galleries (for gallery’s archives)
mydomain/galleries/[gallery_postname] (for the overview of the gallery)
mydomain/galleries/[gallery_postname]/[current_photo_postname] (single photo)
If you have noticed in my site, the galleries always are in /noticias/ directory, this is because I’ve configured to display a page in home and the post below “noticias” ulr
I wish have all galeries below “galeries” directory, same as above explained
I hope you can help me with this, and again sorry for my english and so thank you for the plugin!
How I can create a page (archives page) and display into them the galleries or albums?
The most elegant way to do this, would be to create a category for all the galleries you want to group together and then render the whole category. This would however require a gallery front-end that knows how to deal with categories. I have updated the Shiba Gallery Plugin to render categories, so you may just use that. Or feel free to check out the code and see how to include that in your own gallery front-end.
Another way to do this would be through the back-end – but it is not as elegent and a bit more messy. You could assign the same tag to all the galleries you want to group together, and then create a meta-gallery with the same tag to include all of those galleries. Check the “Only galleries” option on the meta-gallery. This will group all the galleries together – then you can just render the meta-gallery.
In this case, your gallery front-end would need to know how to render gallery type objects. You can also check out the Shiba Gallery Plugin code for an example of how to do this.
is posible to modify or personalize the url to handle this?
Currently, galleries use the same permalink system as posts. You can probably change the permalink structure by writing a hook into the post get permalink function – get_post_permalink. This is the relevant filter call -
apply_filters(‘post_type_link’, $post_link, $id, $leavename);
I will add it to the list for a future release although I may not get to it for a while because I am working on another plugin.
You bring up a really good general point which is that tags can be really powerful if it gets greater support in the WordPress backend.
1. Attachment Tags window on Media part shows tagcloud taken only from posts, not from attachments tags.
2. i would like to have posibility to edit tags like is in Posts part, but included tags assigned to attachments.
Yeah – this is something that I have been thinking about. In the latest release of the plugin I have expanded galleries so that it can also include posts, and other galleries. This makes it more natural to have the same tagging system propagate to all the objects.
However, you bring up a good point which is that most of the time, gallery grouping tags will be different from non-gallery grouping tags.
I will look into generating a tag cloud that just contains tags associated with attachments and galleries.
3. Can Search media search also in tags?
That would be a very good functionality to have.
I will also look into expanding Search Media so that it operates both on the title and on tags.
I am currently working on another plugin, but will get back to Media Library once I am done with it. Thanks for your great feedback!
I’m having trouble activating your plugin.
I get the following error:
Fatal error: Call to undefined function register_post_type() in /public_html/wordpress/wp-content/plugins/media-library-plus/media-library-plus.php on line 264
I’m using NextGen Gallery and Autofocus theme.
What to do? Thanks.
How are you creating your galleries? If you are just creating them as posts, then doing the gallery category thing that you describe sounds like it will work well.
If you are creating galleries with the Media Library Plugin, then just specify ‘post_type’ as ‘gallery’ in your get_posts call.
That is indeed a strange error. I tried duplicating it on 2.9.1 but was unable to do so.
If you deactivate the plugin, does the regular Media Library attachment function work? If so, it may be some kind of conflict with another plugin.
To fix it (only if attachment works when you deactivate the plugin), edit the Media Library Plugin. In particular go into the media-library-plus.php file. Search for -
< ?php find_galleries_div(); ?>
Replace it with -
< ?php find_posts_div(); ?>
This will limit attachments to just regular posts and pages, but it should work.
Meanwhile – if you can let me know what other plugins you are using, I will look into the conflict issue in greater detail. Thanks!
There seems to be a bug in the “Attach” feature. I was able to detach an image from a page but when I go to re-attach it I’m only able to search for posts to attach it to. Regardless of what radio button is checked the search feature continues to display “No Matches found” for names and post ids that are not actual blog posts. I’m using WP 2.9 if that’s any help.
First, sorry for my english. however I need some help
I need to put in my homepage something like this http://i47.tinypic.com/1zzs1u0.jpg
I’ve tried with nggallery plugin, but it isn’t adjust to my needs.
I need something simple, using if posible Internal WordPress functions or API.
with a widget is posible to do this?, with only wordpress gallery integration?
If the gallery is attached to a entry isn’t problem, so I could modify to display only the gallery attached to post.
I don’t need to teach to me the coding this, only a clue.
I am versed with PHP but I’m a really newbie with wordpress.
The approach I would take is to write a gallery plugin that displays WordPress galleries in the way that you describe above. Then you can link your new gallery display function to the WordPress gallery shortcode.
hi, thanks so much for the help,
How I can get directly from my template, the latest galleries created?
and then make a loop and display in list with a thumbnail ?
I though doing it with a ‘query’ to get all posts with category “gallery”.
What is the best way?
thanks! (I’m reading the fully wordpress documentation )
*sorry for my english
Your plugin is a quite simple and so powerful at the same time, in fact it would be for me the best gallery for wordpress available out there.
I’m wondering if You have plans to make a extend your plugin.
It will be amazing if you make a gallery page (http://www.engadget.com/galleries/) and widget like engadget (see Galerias Destacadas section: http://es.engadget.com/)
I’ve been thinking to modify your plugin to get something like that. (custom page for galleries, get by categories, tags, etc, and custom page for single albums)
well, I’ll be waiting for updates.
Thanks
PS.
I think just found a bug, when clicked “set thumbnail”: nothing happens.
Glad everything worked out well and thanks for your great suggestions!
I’ve been thinking to modify your plugin to get something like that. (custom page for galleries, get by categories, tags, etc, and custom page for single albums)
I will definitely have to code something up that does that and it will fit in really well with making the thumbnail system work on gallery objects.
I think what will work well is to create a new gallery type that will contain posts instead of attachments. Then you can display the gallery of posts/attachment-galleries using the same front-end gallery system. However, with the post_gallery you will be linking to posts instead of to an attachment.
It will be very cool! That is a very awesome idea!
If you want to extend the plugin please feel free to do so.
Thanks Keoshi!
Btw. send me a link of your new gallery when it is up. Would love to check it out.
Heya Keoshi,
I have added in the ability to edit the entire gallery permalink structure.
Please let me know if you run into any problems and have new feature suggestions.
I will test and implement new features, I’ll notice you soon
thank you!
Hi Keoshi,
Always good to see you.
Currently, the plugin replaces %postname% in your permalink structure with {gallery base}/%galleryname%. Therefore galleries should show up as -
htt://mysite.com/noticias/galleries/gallery-name
Please let me know if that is not the case.
If you want the gallery permalink to have a different structure, I can insert a filter into the function so that you may alter the gallery permalink structure itself.
What do you want the gallery permalink to look like?
Thanks for the quick reply!
In my site, the news are under with the following structure
/noticias/%postname%
resulting:
http://mysite.com/noticias/{post-title-example}
if apply the word: “galerias” as ‘gallerybase’ for galleries, it results:
http://mysite.com/noticias/galerias/{album-title-example}
I like to have the ‘galleries’ under only ‘/galerias/’ suffix. wich is better to SEO and avoid confusions with the news (noticias)
ie.
http://mysite.com/galerias/%postname%
here is my current permalink structure if it helps
http://img522.imageshack.us/img522/18/permalinks.png
one more time, thanks for support
hello again!
I updated your plugin to test the permalinks option and I’ve noticed that the url is the same in my site, even if I add “galleries” into gallery base
I think this happens because my index page is a page called “noticias” the galleries now is located at htt://mysite.com/noticias/galleries/gallery-name
my custom permalink estructure is “/noticias/%postname%”
any sugestions?
nice plugin shiva!
in multimedia library, i try to search multimedia by tag but nothing happening?, may be there is a bug.
i think a NICE feature to add is searh multimedia by post name, so in this way the neet to use a image tag is less important.
and another HUGH feature may be to import images directly from a url folder!
that’s all, best regard, pescadito
Thanks for reporting the bug Pescadito. I have fixed it in the latest release.
Hmmm, I am not sure what you mean. Do you mean search by the post name slug rather than the post title?
Yeah that was something I considered really early on, but I really wanted a plugin that would work together with the current WordPress media library which assumes that all the images are in the upload folder.
There may be many places in the system that make that assumption, so changing something so fundamental to the core may destabilize many other parts in the system.
Add – after thinking about this some more, I think it will be very possible to do this through the use of rewrite/redirect rules. I will put it on the list for future additions.
hello shibashake, and thank for thinking in this points!
actually i change a bit my point of view:
1) you are rigth: in library multimedia page, i wish to search multimedia library by post title name! so in this way i haven’t really need of ‘tag’ because i find old pictures by post title and reattach or manage it in any way.
2) for the hugh import fro url directory, i finally found http://dd32.id.au/wordpress-plugins/add-from-server/ or http://wordpress.org/extend/plugins/add-from-server/ that make a good work and is enough to me.
3) another nice option to add is the ability to deattach the attached file instead delete the attached file (i mean both options are needed)
so for the meantime i use http://wordpress.org/extend/plugins/change-attachment-parent/ to delete one attachment if i needed
that’s all, the rest work very well to me and i prefer shiba to others media libraries because i have a more standard access to attached files.
thank again, pescadito
The place to hook into is the ‘restrict_manage_posts’ action hook. You should be able to do what you describe by replacing the global $wp_query which is later used to render the list of attachments.
It seems that hooking into ‘restrict_manage_posts’ and then calling query_posts or wp($q) with your own query arguments should do what you want.
The original list of attachments are generated using the wp_edit_attachments_query() function so you can also use that as a starting point.
This is the same mechanism used within the general WordPress Loop.
Hi, thank you for this really great plugin (and also explanation article about its creation – it was very helpfull). Is there any chance to simply limit users (subscribers) to see only their files in Media library? And what about showing only files with specified media tag to specified user? I tried to find any hook or filter, but wit no success
Thank you very much for your help…
Hi Alex,
I would use get_posts and just include in the tag argument.
$tag is a comma separated tag slug list.
http://codex.wordpress.org/Template_Tags/get_posts
Do you want to add the external link only at the front-end? or do you also want to add it on the back-end? If you want to add it to be back-end, I would look into using add_post_meta which will allow you to add new attributes to post objects (i.e. image attachments)
http://codex.wordpress.org/Function_Reference/add_post_meta
If you just want to add it to the front-end, then that would depend on the front-end gallery plugin you are using.
oh, and is it possible to add an external link for each image??
kind regards,
Hi Shibashake,
first off, tx for the plugin. I have just downloaded and i am testing with it.
I do have a question, as i am designing a simple gallery view (just x rows with 4 images) and i still like to use your plugin. I was wondering how i can get the images with a certain tag???
I like to use a loop function.
Any tips, suggestions ?
regards,
Hello again
I’ve updated the plugin, and I see you have supported the post thumbnail option.
I implemented your plugin in a website that I’m working (with a little tweaks in my theme), this is my website www. salesianos.pe (look at “Galeria’s section”) , and I have a question: How I can create a page (archives page) and display into them the galleries or albums?
another question is:
is posible to modify or personalize the url to handle this?
i.e. mydomain.com/galleries (for gallery’s archives)
mydomain/galleries/[gallery_postname] (for the overview of the gallery)
mydomain/galleries/[gallery_postname]/[current_photo_postname] (single photo)
If you have noticed in my site, the galleries always are in /noticias/ directory, this is because I’ve configured to display a page in home and the post below “noticias” ulr
I wish have all galeries below “galeries” directory, same as above explained
I hope you can help me with this, and again sorry for my english and so thank you for the plugin!
Keoshi,
Good to see you again.
The most elegant way to do this, would be to create a category for all the galleries you want to group together and then render the whole category. This would however require a gallery front-end that knows how to deal with categories. I have updated the Shiba Gallery Plugin to render categories, so you may just use that. Or feel free to check out the code and see how to include that in your own gallery front-end.
Another way to do this would be through the back-end – but it is not as elegent and a bit more messy. You could assign the same tag to all the galleries you want to group together, and then create a meta-gallery with the same tag to include all of those galleries. Check the “Only galleries” option on the meta-gallery. This will group all the galleries together – then you can just render the meta-gallery.
In this case, your gallery front-end would need to know how to render gallery type objects. You can also check out the Shiba Gallery Plugin code for an example of how to do this.
Currently, galleries use the same permalink system as posts. You can probably change the permalink structure by writing a hook into the post get permalink function – get_post_permalink. This is the relevant filter call -
apply_filters(‘post_type_link’, $post_link, $id, $leavename);
I will add it to the list for a future release although I may not get to it for a while because I am working on another plugin.
A.M., Thanks for your very good suggestions.
You bring up a really good general point which is that tags can be really powerful if it gets greater support in the WordPress backend.
Yeah – this is something that I have been thinking about. In the latest release of the plugin I have expanded galleries so that it can also include posts, and other galleries. This makes it more natural to have the same tagging system propagate to all the objects.
However, you bring up a good point which is that most of the time, gallery grouping tags will be different from non-gallery grouping tags.
I will look into generating a tag cloud that just contains tags associated with attachments and galleries.
That would be a very good functionality to have.
I will also look into expanding Search Media so that it operates both on the title and on tags.
I am currently working on another plugin, but will get back to Media Library once I am done with it. Thanks for your great feedback!
Hello V8,
It has to do with some of the new features I put in to the new version of the plugin.
If you are using WP 2.8, it may be best to download Media Library Plugin version 2.2.
Let me know if you run into anymore problems. I will also update the article above to include this information. Thanks!
Cool mate!
Version 2.2 runs great!
Thanks for your prompt help!
Hi,
I’m having trouble activating your plugin.
I get the following error:
Fatal error: Call to undefined function register_post_type() in /public_html/wordpress/wp-content/plugins/media-library-plus/media-library-plus.php on line 264
I’m using NextGen Gallery and Autofocus theme.
What to do? Thanks.
By the way, I’m using WP 2.8.4 and I’m also using your plugin on another website of mine with the same version and that works great! Just not this one
I would like to mention some disadvantages of this super plugin.
1. Attachment Tags window on Media part shows tagcloud taken only from posts, not from attachments tags.
2. i would like to have posibility to edit tags like is in Posts part, but included tags assigned to attachments.
3. Can Search media search also in tags?
My tags assigned to attachments are mostly different from those assigned to posts.
I hope i know what i am talking about,
Kind regards!
A. Majewski.
Hi Keoshi,
Yeah you are right the get_posts command is the way to go. Here is some information on the get_posts and query_posts commands. They can be a bit confusing initially.
http://www.shibashake.com/wordpress-theme/wordpress-query_posts-and-get_posts
How are you creating your galleries? If you are just creating them as posts, then doing the gallery category thing that you describe sounds like it will work well.
If you are creating galleries with the Media Library Plugin, then just specify ‘post_type’ as ‘gallery’ in your get_posts call.
$args = array( 'post_type' => 'gallery', 'numberposts' => -1, 'post_status' => null, 'post_parent' => null, // any parent ); $galleries = get_posts($args); if ($galleries) { foreach ($galleries as $gallery) { ... } }Hello Mike,
That is indeed a strange error. I tried duplicating it on 2.9.1 but was unable to do so.
If you deactivate the plugin, does the regular Media Library attachment function work? If so, it may be some kind of conflict with another plugin.
To fix it (only if attachment works when you deactivate the plugin), edit the Media Library Plugin. In particular go into the media-library-plus.php file. Search for -
Replace it with -
This will limit attachments to just regular posts and pages, but it should work.
Meanwhile – if you can let me know what other plugins you are using, I will look into the conflict issue in greater detail. Thanks!
Hi,
There seems to be a bug in the “Attach” feature. I was able to detach an image from a page but when I go to re-attach it I’m only able to search for posts to attach it to. Regardless of what radio button is checked the search feature continues to display “No Matches found” for names and post ids that are not actual blog posts. I’m using WP 2.9 if that’s any help.
Sorry, I’m using WP 2.9.1
I think this is what I was a looking for
I can to do this? http://i47.tinypic.com/1zzs1u0.jpg
best explained: (http://wordpress.org/support/topic/356333)
First, sorry for my english. however I need some help
I need to put in my homepage something like this http://i47.tinypic.com/1zzs1u0.jpg
I’ve tried with nggallery plugin, but it isn’t adjust to my needs.
I need something simple, using if posible Internal WordPress functions or API.
with a widget is posible to do this?, with only wordpress gallery integration?
If the gallery is attached to a entry isn’t problem, so I could modify to display only the gallery attached to post.
I don’t need to teach to me the coding this, only a clue.
I am versed with PHP but I’m a really newbie with wordpress.
Thanks in advance!
Hello Keoshi,
The approach I would take is to write a gallery plugin that displays WordPress galleries in the way that you describe above. Then you can link your new gallery display function to the WordPress gallery shortcode.
If you look at the code of my WordPress Gallery Plugin (which links a variety of javascript galleries to WordPress) – you can see examples of how I did this.
http://www.shibashake.com/wordpress-theme/super-wordpress-gallery-plugin
I just wrote a tutorial on this that may help -
http://www.shibashake.com/wordpress-theme/how-to-render-your-own-wordpress-photo-gallery
hi, thanks so much for the help,
How I can get directly from my template, the latest galleries created?
and then make a loop and display in list with a thumbnail ?
I though doing it with a ‘query’ to get all posts with category “gallery”.
What is the best way?
)
thanks! (I’m reading the fully wordpress documentation
*sorry for my english
i just playing with your code, and the result is almost what I want, thank you!
'gallery', 'numberposts' => 5, 'post_status' => 'any', 'post_parent' => null ); $galleries = get_posts($args); if ($galleries) { foreach ($galleries as $post) { setup_postdata($post); the_title('', ''); the_content(); $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as $attachment) { //echo apply_filters('the_title', $attachment->post_title); the_attachment_link($attachment->ID, false); } } } } ?>Your plugin is a quite simple and so powerful at the same time, in fact it would be for me the best gallery for wordpress available out there.
I’m wondering if You have plans to make a extend your plugin.
It will be amazing if you make a gallery page (http://www.engadget.com/galleries/) and widget like engadget (see Galerias Destacadas section: http://es.engadget.com/)
I’ve been thinking to modify your plugin to get something like that. (custom page for galleries, get by categories, tags, etc, and custom page for single albums)
well, I’ll be waiting for updates.
Thanks
PS.
I think just found a bug, when clicked “set thumbnail”: nothing happens.
Glad everything worked out well and thanks for your great suggestions!
I will definitely have to code something up that does that and it will fit in really well with making the thumbnail system work on gallery objects.
I think what will work well is to create a new gallery type that will contain posts instead of attachments. Then you can display the gallery of posts/attachment-galleries using the same front-end gallery system. However, with the post_gallery you will be linking to posts instead of to an attachment.
It will be very cool! That is a very awesome idea!
If you want to extend the plugin please feel free to do so.
Thanks Keoshi!
Btw. send me a link of your new gallery when it is up. Would love to check it out.
Is this plugin on the WordPress plugin database?
Unfortunately no. My site was ‘too commercial’
DO a clearly visible Download Link, be human!
Sorry for your troubles.
Hope it is better now and thanks for letting me know.