custom image dimensions (for gallery)

You can call add_image_size in your functions.php: add_image_size( ‘medium’, 240, 160, true ); Reference here: http://codex.wordpress.org/Function_Reference/add_image_size

JavaScript and images files are not recognized

You need to give the full path to your theme files. To get the URL of your theme, use the WordPress function bloginfo( ‘template_directory’ ); so at a minimum you would need: <script src=”https://wordpress.stackexchange.com/questions/18828/<?php bloginfo(“template_directory’ ) ?>/jquery.js” type=”text/javascript”></script> However, scripts / styles should really be “enqueued” using wp_enqueue_script(); (see http://codex.wordpress.org/Function_Reference/wp_enqueue_script) I would recommend taking a … Read more

Images not working using Featured post

I believe there are some root-links that you haven’t changed. Please follow these steps Login to admin section www.xyz.com/wp-admin Navigate to settings->general-> and change the ‘Site Address (URL)’ and ‘WordPress Address (URL)’. Also please check the permalinks and settings->media there is an upload directory and the default wordpress location is wp-content/uploads, check if it is … Read more

Can I the caption shortcode to set caption to a data attribute, and with the image’s alignment intact?

Basically the img_caption_shortcode filter allows you to completely replace the default image caption. If you want to do that, you’ll need to ask WP to pass all the argument of the filter to your callback function. <?php add_filter(‘img_caption_shortcode’, ‘wpse81532_caption’, 10, 3 /* three args */); Then your callback will need to take care of all … Read more

Problem with loading images from child theme CSS file with relevant path

There’s no need for the wp-content/themes path – both themes sit in the same directory, so you can just traverse up one and then back down to child theme: background-image: url(../child-theme-name/images/some-image.png); Update: Regarding your answer to “where is the CSS file stored”, you inferred that the stylesheet resides in the child theme folder – in … Read more

Bulk image rotation

Yes, this is a known problem between ios devices and WordPress. It’s a real issue due to the high numbers of iPhone/ipad users who also use WordPress, and I’m surprised it hasn’t been addressed in the WordPress core. Looks like it’s still being debated/ worked on here. It’s a question that’s been asked before here. … Read more

Add a new data attribute in tag

I found the solution to add that attribute to the img tag with this function: add_filter(‘the_content’,’new_content’); function new_content($content) { $content = str_replace(‘<img’,'<img data-qazy=”true”‘, $content); return $content; }

Frontend Post – Allow Only Image File Upload

You can check mime type of uploaded image before upload to media. Add mimeTypes in $allowmimeType which you want to allow. then check uploaded files mimetype $fileMimeType. If not found in allowed mimetype then return false. // Insert Attachment function insert_attachment($file_handler, $post_id, $setthumb=’false’) { if ($_FILES[$file_handler][‘error’] !== UPLOAD_ERR_OK){ return __return_false(); } # uploaded file type … Read more

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