How to Make Only Images Connected to a Post Show? Not Entire Media Collection?

add_action( ‘admin_footer-post-new.php’, ‘firmasite_mediapanel_lock_uploaded’ ); add_action( ‘admin_footer-post.php’, ‘firmasite_mediapanel_lock_uploaded’ ); function firmasite_mediapanel_lock_uploaded() { ?> <script type=”text/javascript”> jQuery(document).on(“DOMNodeInserted”, function(){ // Lock uploads to “Uploaded to this post” jQuery(‘select.attachment-filters [value=”uploaded”]’).attr( ‘selected’, true ).parent().trigger(‘change’); }); </script> <?php } Just place that into your child-theme’s functions.php file 🙂

How to display posts with images in fullscreen slider

You can use this code bellow with Query: <div class=”w3-content w3-display-container”> <?php $slider = new WP_Query(array( ‘post_type’ => ‘post’, ‘posts_per_page’ => 5, ‘post_status’ => ‘publish’, )); if($slider->have_posts()) : while($slider->have_posts()) : $slider->the_post(); ?> <div class=”w3-display-container mySlides”> <a href=””> <?php the_post_thumbnail(‘large’); ?> <div class=”w3-display-bottomleft w3-large w3-container w3-padding-16 w3-black”> Trolltunga, Norway </div> </a> </div> <?php endwhile; endif; ?> … Read more

Server peek by Own-IP-Calls?

Absolute URLs are not the reason for your problems. Relative and absolute links stress servers the same way. There can be a problem if you load all your content at once (e.g. hundred of images). You can solve this issue with AJAX (loading content on demand).

How to source control manage site images

Whatever is in the wp-content/uploads directory is not source, it is data, some of it is automatically generated. Images related to source code, like images used in CSS should “live” in the theme or plugin files. It is possible to use the likes of GIT over that directory, but the results will lack any sensible … Read more

How can the alt be added to this wooCommerce category image?

Something like this? $image_alt = get_post_meta( $image->id, ‘_wp_attachment_image_alt’, true); To use in your string: if ($image) echo ‘<img src=”‘ . esc_url($image) .'” alt=”.$image_alt.”>woocommerce-CJD”>’; Use it under the $image declaration. In your $image declaration make sure youll get the image attachment via wp_get_attachment_image() function.

Image linking and lightbox

So, the problem is that on Expositio theme they are adding some jQuery code to all links, that if you’re not closing the mobile menu, after a configurable number of seconds (1 second by default) just redirect site to the link url. If you go to line 260 of js/functions.js you find this: $(‘a’).on(‘click’, function(e) … Read more

Adding a URL Parameter to JPEG images in posts

function add_jpeg_params($content){ preg_match_all(“/https?:\/\/[^\/\s]+\/\S+\.(jpg|jpeg)/”, $content, $output_array); $items_to_replace = array_unique($output_array[0]); $items_to_replace = array_values($items_to_replace); for ($j = 0; $j < sizeof($items_to_replace); $j++) { $content = str_replace($items_to_replace[$j], $items_to_replace[$j] . ‘?t=” . time(), $content); } return $content; } add_filter(“the_content’,’add_jpeg_params’,10); add_filter(‘post_thumbnail_html’, ‘add_jpeg_params’ );

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