Images in sub-pages fail to load

Your problem has nothing to do with htaccess. It’s that you’re using relative paths where you should be using absolute paths. (Here’s an explanation of the difference) Probably the best way to reference any assets in your theme (assuming your theme has an “images” subdirectory) is to do something like: <?php echo get_bloginfo(‘template_url’) ?>/images/your_image.jpg The … Read more

Storing images on a local site

There are different approaches to managing media. Most common (from my perception) are: making live site master copy of data (not doing any data input in local) use deployment process that takes care of URL change map live domain to local install while working with it store media in third location (another server, Amazon S3, … Read more

greater flexibility in targeting images attached to page

Every file that is uploaded in WordPress is an Attachment, which is a kind of post (‘post_type’ => ‘attachment’). When the file is uploaded inside a Post or Page, it is attached to that particular post/page (‘post_parent’ => $post->ID). I can think of a solution that doesn’t involves any particular coding: you simply have to … Read more

Aviary + WordPress Media

I just Finished a part of my theme framework which Integrates aviary editor to WordPress media library and since i was asked, I released it in a plugin form Aviary Editor

Wrap a post image with a div if it doesn’t have a caption

You could try with if(is_admin()){ add_filter(‘image_send_to_editor’, ‘wrap_my_div’, 10, 8); function wrap_my_div($html, $id, $caption, $title, $align, $url, $size, $alt) { if( isset($caption) && $caption ) return $html; else return ‘<div class=”mydiv” id=”mydiv-‘.$id.'”>’.$html.'</div>’; } }

trouble with featured image

When you set that final argument of add_image_size() to false, it scales the image down until the height or width matches one of the set values, then it maintains the proportions. For example: A 600px by 400px image using your settings is 134px wide (the long dimension) and then 89px tall (proportional to 134px wide). … Read more

How do I add a nested conditional within an echo – to use a default image if there isn’t one in the post?

try this $second_query = new WP_Query( $args ); if ( $second_query->have_posts() ): while( $second_query->have_posts() ) : $second_query->the_post(); $attachment_id = get_field(‘image’); $size = “customfeatins”; // (thumbnail, medium, large, full or custom size) $my_image = wp_get_attachment_image_src( $attachment_id, $size ); if (!my_image !== ”){ $image = $my_image[0]; } else { $image=”http://domain/image_source/your_image.jpg”; } endif; echo ‘<article> <img src=”‘ . … Read more

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