Change WordPress Shortcode added in to post

remove_shortcode( ‘gallery’ ); add_shortcode( ‘gallery’, function( $atts ) { $atts = shortcode_atts( array( ‘ids’ => ” ), $atts ); return do_shortcode( “[wp-slideshow include=\”$atts[ids]\”]” ); } ); This may be better than replacing the gallery shortcode as if you decide to change plugin you will have the standard gallery shortcode which many plugins will work with … Read more

Custom Gallery HTML only working when images are attached to post/page

You’re not passing your attribute array to the shortcode_atts method. You’re passing in an uninitialized variable. Your function starts with function get_my_gallery_content ( $atts ) { But then you don’t reference $atts again. The code is reading $attr, which is empty. Change the line ), $attr, ‘gallery’)); to ), $atts, ‘gallery’)); You also need to … Read more

How to Modify WordPress Default Image Gallery Shortcode

You could try this plugin: https://wordpress.org/plugins/wp-pagination/ It makes a javascript approach to paging. For my projects i always started to build galleries using custom post types or repeaterfields with acf: http://www.advancedcustomfields.com/add-ons/repeater-field/ WordPress built in gallery function is… well almost unfunctional. 🙂

Override img class in gallery

You should add !important to your styles in order to override it. Better way to do this is to copy the .img-responsive styles from the Bootstrap CSS file and apply these styles to your desired HTML element instead of adding a class using PHP. img.attachment-large { display: block; max-width: 100%; height: auto; } Or target … Read more

WordPress show Gallery Title and Captions

get_post_gallery_images only returns a singular array of image URLs, so $image->post_title etc won’t work, hence your error message. The approach generally is off – you’ve followed the codex for get_post_gallery_images but that snippet is aimed at re-using the image urls within the post, but outside the gallery output. get_attached_media is more suited here (just a … Read more

WooCommerce-like featured gallery

I found a solution to this. I am using the plugin (No UI) Metabox that has this feature by default. This is the code i used to achieve my desired result: add_filter( ‘rwmb_meta_boxes’, ‘prefix_register_meta_boxes’ ); function prefix_register_meta_boxes( $meta_boxes ) { $prefix = ‘rw_’; $meta_boxes[] = array( ‘title’ => ‘Media’, ‘pages’ => array( ‘bestilling’), ‘fields’ => … Read more

Add a class to the anchor tag on HTML5 gallery

f you mean to add a class on the anchor image wrapper that you have added using wp-editor then you could add folllowing code : this will filter the content and add class to your image <?php function add_class_to_gallery($content) { $classes=”gallery-link”; // check if there are already a class property assigned to the anchor if … Read more

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