Make different border color gallery items

in case you using SASS: you can use this snippet and change accordingly $colors: red, orange, yellow, green, blue, purple; $repeat: 20 // How often you want the pattern to repeat. // Warning: a higher number outputs more CSS. @for $i from 1 through $repeat { .gallery img:nth-child(#{length($colors)}n+#{$i}) { border-color: lighten(nth($colors, random(length($colors))), 20%); } } … Read more

WordPress Gallery is not displaying

Waited a lot but couldn’t find an answer… I found the issue but doesn’t know how to resolve it. But fortunately there is a way around it. I have been using wordpress’s pre_get_posts hook to set a tax_query which looks like this: add_action( ‘pre_get_posts’, ‘homeInjector’ ); function homeInjector( $query ) { if ( $query->is_home() ) … Read more

Unable to save multiple images in wordpress

You are updating the same post_meta on each loop. Therefore you are probably saving the last uploaded image only. Try something like this (simplified): foreach ($_FILES[‘wp_custom_attachment’][“tmp_name”] as $key => $value) { $post_meta = get_post_meta($id, ‘wp_custom_attachment’, $upload); if( $post_meta ) { $post_meta .= ‘, ‘ . $upload; update_post_meta($id, ‘wp_custom_attachment’, $post_meta); } else { add_post_meta($id, ‘wp_custom_attachment’, $upload); … Read more

Add title tag to image in wordpress gallery

The ‘img’ tag is built via the theme code for display on the page. So, you would have to modify the theme code to add to the img tag. Note that modifying theme code directly is not generally advised, as a theme update will overwrite your changes. “Child” themes are best used for this modification.

Return only one post format in index.php [duplicate]

I solved the problem. All I need to add is the following line of code query_posts( $args ); The result will be something like this: <div class=”content”> <?php if (have_posts()) : ?> <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $total_post_count = wp_count_posts(); $published_post_count = $total_post_count->publish; $total_pages = ceil( $published_post_count / $posts_per_page ); if ( … Read more

Integrate video and iframe in a post type gallery

The problem is that image is not a proper mime type. You can see a list of mime-types here – so based off the linked list we need to pass an array of what we need: $supported_mimes = array( ‘image/jpeg’, ‘image/gif’, ‘image/png’, ‘video/avi’, ‘video/x-flv’, ‘video/mp4’, ‘video/ogg’, ‘video/webm’, ); $args = array( ‘numberposts’ => -1, // … Read more

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