Tag Info

New answers tagged

0

I understand the issue and have these additions from my own research. I have found the way, but it requires paying for a subscription based service (Uploading Photos to WordPress with a Lightroom Publish Service): http://havecamerawilltravel.com/photographer/lightroom-wordpress-publish-service Another tidbit was the workflow by Scot Kelby, which discusses ...


0

I found the solution. Rename your function.php file. Now it works fine for other themes. In my theme exactly the problem lies between the style tag. remove style tags and then check your admin panel. Thanks.


0

Hey Only Change the code like this function cult_customizer_register( $wp_customize ) { $wp_customize->add_section( 'cult_topic_thumb' , array( 'title' => __( 'Topic of the Week' ), 'priority' => 36, 'description' => 'Allows you to upload an image for your topic of the week section.', ) ); ...


0

A little late to this party but it seems the OP wants to (1) prevent these WP Selfies from recurring and (2) remove existing WP Selfies. Here is a great filter to prevent it from happening in the future: http://andrewnorcross.com/tutorials/stop-hyperlinking-images/. And I just posted a snippet that removes existing self linking images here: ...


1

Instead of your code for image, use this following. <?php $thumb_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 120, 90, true ); ?> <img src="<?php echo $thumb_image[0]; ?>" alt="<?php echo esc_html( get_the_title() ); ?>" width="<?php echo $thumb_image[1]; ?>" height="<?php echo $thumb_image[2]; ...


1

Just use the public API functions: has_shortcode( $content, $tag );. It uses shortcode_exists( $shortcode ); internally to search the global $shortcode_tags array for the shortcode you are searching for. If that is successful, it uses get_shortcode_regex() to search for the actual shortcode - this will save you quite some time and avoid mistakes. ...


0

You can do preg_match to check if the content contains gallery shortcode <?php $re = "/\\[metaslider id=([0-9]+).*]/s"; if(preg_match($re, get_the_content(), $matches) && has_post_thumbnail()){ ?> <p class="post-gallery"><?php the_field('post_gallery'); ?></p> ...


0

found the solution: <div class="fill" style="background-image:url('<?php $custom = MultiPostThumbnails::get_post_thumbnail_id(get_post_type(), 'header-image', $post->ID); $custom=wp_get_attachment_image_src($custom,'header image'); echo $custom[0]; ?>');"></div>


0

A few hours ago, I was wondering how to do that too. But, soon I got the solution and made a plugin, please check whether get_avatar_url($user_id, $size) works for you or not. Thanks.. Plugin code: /* Plugin Name: Get Avatar URL Plugin URI: https://github.com/faizan1041/get-avatar-url Description: get_avatar returns image, get_avatar_url will give you ...


1

All of the code in your question can be replaced with: require_once( ABSPATH . 'wp-admin/includes/image.php' ); require_once( ABSPATH . 'wp-admin/includes/file.php' ); require_once( ABSPATH . 'wp-admin/includes/media.php' ); if ( $_FILES ) { foreach ($_FILES as $file => $array) { $image_post_id = media_handler_upload( $file ); if ( is_wp_error( ...


0

It looks like Wordpress 4.0 (or earlier) has removed the need for the editor, as I was able to easily not include it.


0

Well, after some discussion with the developer, I was missing some key items in the add_filter line. I needed to pass along the "11","3". The three is the important item here. It is the number of variables to passback... the 3rd being the elusive $imgID. function massage_exif($content,$postID,$imgID){ $imgmeta = wp_get_attachment_metadata($imgID); ...


0

Try changing "siteurl" and "home" in your wp_options table. The rest of the paths should stay the same then.


1

By using wp_get_attachment_image_src() function get the original url of thumbnail if ( has_post_thumbnail() ) { $image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); $image = $image_url[0]; } Then add Image Url to your custom code <a href="<?php echo $image; ?>"><img class="alignright size-medium ...


1

If you know the image's ID : wp_get_attachment_image( $image->ID, array(200, 112) ); returns an HTML img element or empty string on failure. The entire code could be something like : <a href="<?= get_attachment_link( '5435' ); ?>"> <?= wp_get_attachment_image( '5435', array(200, 112) ); ?> </a>


0

If you know the image ID, you could try this function: http://codex.wordpress.org/Function_Reference/wp_get_attachment_image_src


0

This is called Post Thumbnails. It was set by your theme. You can open file functions.php and search for set_post_thumbnail_size. If found, change it : set_post_thumbnail_size(9999999,999999) If not found, just insert new line.


0

This can be achieved by either creating an image size using <?php add_image_size( 'my-image-size', 1000, 400, true ); ?> or you can implement the Aqua Resizer to your theme/plugin. Aqua Resizer works almost in the same fashion as the good old TimThumb, but instead saves the image as a correct image size in WordPress using WordPress' intermediate sizes ...


-2

You are probably missing ImageMagick (PHP extension). Install it and the JPG artifacts will be gone.


0

Here is my working solution. The code is documented, so it should be clear what each function does. I pretty much use the wp_generate_attachment_metadata filter to create the needed images after the image has been uploaded. The generated images are listed in the metadata too, like any other intermediate image size. That way you can pretty much work with ...


0

I am aware of that, but that still means you have to click through several images before you can find the one you are looking for


0

Clicking on the image will display all of the information about it, including the file name, on the right.


0

Whenever you create a gallery, in the gallery settings (right side of the Edit Gallery screen), you have the option Link to: Link to attachment page Link to media file Nothing Link to media file will open the image. Be advised that without some form of Lightbox plugin, the image will NOT open in an overlay/lightbox, but instead as a new document. There ...


0

When the avatar has been uploaded locally, WP, returns the img tag with the src attribute in double quotes, so I found this pattern worked better: preg_match("/src=['\"](.*?)['\"]/i", $get_avatar, $matches);


0

There is an easier solution now: function my_gallery_default_type_set_link( $settings ) { $settings['galleryDefaults']['link'] = 'file'; return $settings; } add_filter( 'media_view_settings', 'my_gallery_default_type_set_link'); They added a filter to customize this default value (and other values related to the new media upload popup) in WP 4.0 ...


-1

Why not just use Gravity Forms with ACF. It does exactly what you're suggesting -- and I've used it a number of times on client sites with great success.


0

If all you do is update ACF fields with your form, why not use the built-in function to generate the form? Create a new ACF field for the images, or simply use the Gallery field type, then display the form using acf_form: <?php acf_form(array( 'post_id' => 'new_post', 'new_post' => array( 'post_type' => 'vendre', ...


0

You can try this one-liner, within the loop, instead of all your above code: $ids = join( ',', wp_list_pluck( get_attached_media('image' ), 'ID' ) ); where we pluck out the ID's from the get_attached_media() output. Another approach would be to use: $ids = join( ',', get_attached_media( '_image_ids' ) ); where we've introduced a new input parameter ...


3

Actually WordPress reduce quality of image when you upload it via media uploader. WordPress has built in compression for JPG images. Whenever you upload an JPG/JPEG image to WordPress media library, WordPress will automatically compress your images to 90% of the original quality, this is intended to help your pages load faster and keep file sizes smaller. ...


0

Normally this might due to some discrepancy from default set values for image in functions.php in wordpress and check whether any default values is set for the images in that file. You also can set it manually in function.php file as below. add_theme_support('post-thumbnails'); update_option('thumbnail_size_w', 200); update_option('thumbnail_size_h', 200); ...



Top 50 recent answers are included