custom meta box data not saved

So actually, for posts of the type attachment, you should use the edit_attachment (action) hook and not save_post_attachment: add_action( ‘edit_attachment’, ‘save_image_link’ ); // use edit_attachment //add_action( ‘save_post_attachment’, ‘save_image_link’ ); // not save_post_attachment Secondly, your meta box is not currently displaying the meta value, so you should display the value in the input field, and you … Read more

Some doubts about gallery shortcode in WordPress

If you want to display the attached image gallery, from another post, you can use: where the custom id attribute is the post ID. If you want limit the number of items in a gallery, there seems to be a plugin available on wordpress.org called Limit parameter for gallery shortcode (no affiliation). It uses the … Read more

NextGen – Display Image Count Per Gallery

Using your above code, you were just missing the WHERE clause. Hopefully that should work. <?php global $wpdb; $images = intval( $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->nggpictures WHERE galleryid = {$gallery->ID}”) ); ?> <a rel=”prettyPhoto” href=”https://wordpress.stackexchange.com/questions/73192/<?php echo $image->imageURL ?>” <?php $image->thumbcode ?>> <span>view</span> </a> <?php echo $images; ?> pictures It’s not the best way to implement it, … Read more

How to get all attachment image from post ?? WordPress

<?php /* * Template Name: Gallery Page */ $query_images_args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => – 1, ); $query_images = new WP_Query( $query_images_args ); ?> <?php get_header();?> <div class=”main”> <div class=”row”> <?php foreach ( $query_images->posts as $image ) {?> <div class=”col-md-3″> <img src=”<?php echo wp_get_attachment_url($image->ID); ?>” > <a … Read more

How to get post attachments in gallery post format template

i had sort out this with function get_post_gallery find the answer if ( ! function_exists( ‘flexi_gallery_slideshow’ ) ) : /** * Display an optional post read more link * */ function flexi_gallery_slideshow( ) { echo ‘<ul class=”bxslider”>’; if ( get_post_gallery() ) : $gallery = get_post_gallery( get_the_ID(), false ); /* Loop through all the image and … Read more

WordPress 3.5 Gallery Menu Order not set?

it seems to me, after going through the source codes (both PHP and JS), that gallery and it’s order is not saved to database at all. Gallery exists only in JS when you are creating that and even does not persist when you leave a post editing page. Gallery gets saved only by inserting gallery … Read more

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