Where does the gallery shortcode gets its attachments from?

This completely depends on how your gallery shortcode looks like. If you replaced it with something custom, then you’ll have to take a look at the plugin (or the theme). The default gallery shortcode gets it from a query: $query_args = array( ‘post_status’ => ‘inherit’ ,’post_type’ => ‘attachment’ ,’post_mime_type’ => ‘image’ ,’order’ => $order ,’orderby’ … Read more

Add Download Button in prettyPhoto Plugin

Well programmers can make use of the prettyPhoto documentation and modify the plugin after the wp_footer() call in footer.php: Add the button via image_markup Give prettyPhoto a little height boost after adding the Download button. <?php wp_footer();?> <style>.download-btn{ margin-top: 10px; padding: 5px; background: #ccc; float: left }</style> <script> jQuery(document).ready(function() { jQuery(“a[rel^=’prettyPhoto’]”).prettyPhoto({ image_markup: ‘<img id=”fullResImage” src=”https://wordpress.stackexchange.com/questions/68012/{path}” … Read more

Adding option to Gallery shortcode

This code should work in your functions.php add_shortcode(‘gallery’, ‘custom_gallery_function’); function custom_gallery_function($atts) { $user = wp_get_current_user(); // if current user isn’t admin, add posts to be hidden to exclude if(!in_array(‘administrator’, $user->roles)) $atts[‘exclude’] = $atts[‘exclude’] . ‘,’ . $atts[‘hide’]; // call the wordpress shortcode function return gallery_shortcode($atts); }

wordpress get gallery images title

In WordPress attachments are stored as posts so you can use most of the post specific WordPress calls and functions to read/write data associated with the attachment. This applies to post meta data for an attachment as well. So in this case, since you have the post ID ( same as $attachment_id ) you can … Read more

Large Media Library

I would not do it post by post I would use a plugin so I can manage it more and present them in lightbox or as a gallery. Plus in the future if you want to blog or add news you can always use the posts for that. Nextgen Gallery has been around for some … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)