Permalinks for thumbs with get_post_gallery

You need to split the get_post_gallery ids string into an array before you can loop through it. $parent = get_post_field( ‘post_parent’, get_the_ID() ); $gallery = get_post_gallery($parent, false); $ids = explode(‘,’, $gallery[ ‘ids’ ]); foreach($ids as $attachment_id) { $img_src = wp_get_attachment_image_url($attachment_id, ‘medium’); $img_srcset = wp_get_attachment_image_srcset($attachment_id, ‘medium’); $title = get_the_title($attachment_id); ?> <a href=”https://wordpress.stackexchange.com/questions/212996/<?php echo get_permalink($attachment_id); ?>”> <img … Read more

On IIS, stop WordPress from resaving my web.config file when I enter the Permalinks config page

You can prevent a “hard” flush, which updates .htaccess (Apache) or web.config (IIS), with the flush_rewrite_rules_hard filter. We can also use the __return_false helper function here. add_filter( ‘flush_rewrite_rules_hard’, ‘__return_false’ ); This code can be placed in your own plugin or a theme’s functions.php file.

Permalink problem ( Blog posts vs custom post types)

You have to set with_front to false when you register the post type to prevent any static prefix in your permalink structure from being prepended on custom post type permalinks. $args = array( ‘rewrite’ => array( ‘slug’ => ‘product’, ‘with_front’ => false ), // other args… );

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